From bc5b71666867c00e7dc850740bb5cc2a13a9c2a9 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 21 Apr 2025 12:19:11 +0200 Subject: 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. --- config.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'config.c') 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, -- cgit v1.3