diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-04-21 10:19:11 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-04-26 12:43:42 +0000 |
| commit | bc5b71666867c00e7dc850740bb5cc2a13a9c2a9 (patch) | |
| tree | b37c0637d15f8750857b97362038d7b25dcec38b /config.c | |
| parent | csi: 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.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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, |
