aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-04-21 10:19:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-04-26 12:43:42 +0000
commitbc5b71666867c00e7dc850740bb5cc2a13a9c2a9 (patch)
treeb37c0637d15f8750857b97362038d7b25dcec38b /config.c
parentcsi: implement private mode 2031 (dark/light mode detection) (diff)
config: add initial-color-theme=1|2
This option selects which color theme to use by default. I.e. at startup, and after a reset. This is useful with combined theme files, where a single file defines e.g. both a dark and light version of the theme.
Diffstat (limited to 'config.c')
-rw-r--r--config.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/config.c b/config.c
index 921b2d68..7dc41aa6 100644
--- a/config.c
+++ b/config.c
@@ -1098,6 +1098,15 @@ parse_section_main(struct context *ctx)
return true;
}
+ else if (streq(key, "initial-color-theme")) {
+ _Static_assert(
+ sizeof(conf->initial_color_theme) == sizeof(int),
+ "enum is not 32-bit");
+
+ return value_to_enum(ctx, (const char*[]){"1", "2", NULL},
+ (int *)&conf->initial_color_theme);
+ }
+
else {
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
return false;
@@ -3402,7 +3411,7 @@ config_load(struct config *conf, const char *conf_path,
.url = false,
},
},
-
+ .initial_color_theme = COLOR_THEME1,
.cursor = {
.style = CURSOR_BLOCK,
.unfocused_style = CURSOR_UNFOCUSED_HOLLOW,