config: add new section 'colors2'

This section defines an alternative color theme. The keys are the same
as in the 'colors' section, as are the default values.

Values are *not* inherited from 'colors'. That is, if you set a value
in 'colors', but not in 'colors2', it is *not* inherited by 'colors2'.
This commit is contained in:
Daniel Eklöf 2025-04-20 07:36:58 +02:00
parent 01c43f1644
commit 1423babc35
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 21 additions and 0 deletions

View file

@ -1521,6 +1521,12 @@ parse_section_colors(struct context *ctx)
return parse_color_theme(ctx, &ctx->conf->colors); return parse_color_theme(ctx, &ctx->conf->colors);
} }
static bool
parse_section_colors2(struct context *ctx)
{
return parse_color_theme(ctx, &ctx->conf->colors2);
}
static bool static bool
parse_section_cursor(struct context *ctx) parse_section_cursor(struct context *ctx)
{ {
@ -2900,6 +2906,7 @@ enum section {
SECTION_URL, SECTION_URL,
SECTION_REGEX, SECTION_REGEX,
SECTION_COLORS, SECTION_COLORS,
SECTION_COLORS2,
SECTION_CURSOR, SECTION_CURSOR,
SECTION_MOUSE, SECTION_MOUSE,
SECTION_CSD, SECTION_CSD,
@ -2930,6 +2937,7 @@ static const struct {
[SECTION_URL] = {&parse_section_url, "url"}, [SECTION_URL] = {&parse_section_url, "url"},
[SECTION_REGEX] = {&parse_section_regex, "regex", true}, [SECTION_REGEX] = {&parse_section_regex, "regex", true},
[SECTION_COLORS] = {&parse_section_colors, "colors"}, [SECTION_COLORS] = {&parse_section_colors, "colors"},
[SECTION_COLORS2] = {&parse_section_colors2, "colors2"},
[SECTION_CURSOR] = {&parse_section_cursor, "cursor"}, [SECTION_CURSOR] = {&parse_section_cursor, "cursor"},
[SECTION_MOUSE] = {&parse_section_mouse, "mouse"}, [SECTION_MOUSE] = {&parse_section_mouse, "mouse"},
[SECTION_CSD] = {&parse_section_csd, "csd"}, [SECTION_CSD] = {&parse_section_csd, "csd"},

View file

@ -304,6 +304,7 @@ struct config {
tll(struct custom_regex) custom_regexes; tll(struct custom_regex) custom_regexes;
struct color_theme colors; struct color_theme colors;
struct color_theme colors2;
struct { struct {
enum cursor_style style; enum cursor_style style;

View file

@ -1084,6 +1084,15 @@ can configure the background transparency with the _alpha_ option.
Flash translucency. A value in the range 0.0-1.0, where 0.0 means Flash translucency. A value in the range 0.0-1.0, where 0.0 means
completely transparent, and 1.0 is opaque. Default: _0.5_. completely transparent, and 1.0 is opaque. Default: _0.5_.
# SECTION: colors2
This section defines an alternative color theme. It has the exact same
keys as the *colors* section. The default values are the same.
Note that values are not inherited. That is, if you set a value in
*colors*, but not in *colors2*, the value from *colors* is not
inherited by *colors2*.
# SECTION: csd # SECTION: csd
This section controls the look of the _CSDs_ (Client Side This section controls the look of the _CSDs_ (Client Side

View file

@ -164,6 +164,9 @@
# search-box-match=<regular0> <regular3> # black-on-yellow # search-box-match=<regular0> <regular3> # black-on-yellow
# urls=<regular3> # urls=<regular3>
[colors2]
# Alternative color theme, see man page foot.ini(5)
[csd] [csd]
# preferred=server # preferred=server
# size=26 # size=26