diff --git a/libs/argv.c b/libs/argv.c index 99c025e..e3b83b5 100644 --- a/libs/argv.c +++ b/libs/argv.c @@ -19,12 +19,16 @@ void readargs(int argc, char *argv[]) { loadconfig = 0; } else if (!strcmp(argv[j], "-ltm") || (!strcmp(argv[j], "--load-theme"))) { loadtheme = 1; + theme_override = 1; } else if (!strcmp(argv[j], "-nltm") || (!strcmp(argv[j], "--no-load-theme"))) { loadtheme = 0; + theme_override = 1; } else if (!strcmp(argv[j], "-lbi") || (!strcmp(argv[j], "--load-binds"))) { loadbinds = 1; + binds_override = 1; } else if (!strcmp(argv[j], "-nlbi") || (!strcmp(argv[j], "--no-load-binds"))) { loadbinds = 0; + binds_override = 1; } else if (!strcmp(argv[j], "-x11") || (!strcmp(argv[j], "--x11"))) { protocol = 0; protocol_override = 1; diff --git a/libs/conf/config.c b/libs/conf/config.c index b5c5a82..c3c1ae4 100644 --- a/libs/conf/config.c +++ b/libs/conf/config.c @@ -664,8 +664,14 @@ void conf_init(void) { config_setting_t *conf = config_setting_get_elem(file_setting, i); // look up - config_setting_lookup_int(conf, "theme", &loadtheme); // spmenu.file.theme - config_setting_lookup_int(conf, "binds", &loadbinds); // spmenu.file.binds + if (!theme_override) { + config_setting_lookup_int(conf, "theme", &loadtheme); // spmenu.file.theme + } + + if (!binds_override) { + config_setting_lookup_int(conf, "binds", &loadbinds); // spmenu.file.binds + } + config_setting_lookup_int(conf, "global", &globalcolors); // spmenu.file.global config_setting_lookup_int(conf, "xresources", &xresources); // spmenu.file.xresources diff --git a/spmenu.c b/spmenu.c index ed580f8..7ca6fae 100644 --- a/spmenu.c +++ b/spmenu.c @@ -225,9 +225,12 @@ static Draw_t *draw; // Draw_t type, see libs/draw/draw.c static int hplength = 0; static char **hpitems = NULL; +static int theme_override = 0; +static int binds_override = 0; +static int protocol_override = 0; + static int *sel_index = NULL; static unsigned int sel_size = 0; -static int protocol_override = 0; static int itemn = 0; #if USERTL