Fix bind and theme arguments

This commit is contained in:
Jacob 2023-07-28 02:26:49 +02:00
parent a7316968e7
commit 0540eacfd7
3 changed files with 16 additions and 3 deletions

View file

@ -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;

View file

@ -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

View file

@ -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