From 2d08672f86f67aa4fab82219e4e6627eb43ec350 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Fri, 1 Nov 2019 16:57:24 -0700 Subject: [PATCH] There are now secondary config options that match the command line flags if the original options didn't --- src/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main.c b/src/main.c index 4af0714..16fe7c8 100644 --- a/src/main.c +++ b/src/main.c @@ -397,6 +397,7 @@ int main(int argc, char** argv) { //Check if --style was specified if(style_str == NULL) { style_str = map_get(config, "stylesheet"); + style_str = style_str == NULL ? map_get(config, "style") : style_str; if(style_str == NULL) { const char* style_f = "/style.css"; stylesheet = utils_concat(2, CONFIG_LOCATION, style_f); @@ -414,6 +415,7 @@ int main(int argc, char** argv) { //Check if --color was specified if(color_str == NULL) { color_str = map_get(config, "colors"); + color_str = color_str == NULL ? map_get(config, "color") : color_str; if(color_str == NULL) { color_path = strdup(COLORS_LOCATION); } else { @@ -429,6 +431,10 @@ int main(int argc, char** argv) { free(COLORS_LOCATION); + if(map_get(config, "show") != NULL) { + map_put(config, "mode", map_get(config, "show")); + } + if(strcmp(get_exec_name(argv[0]), "dmenu") == 0) { map_put(config, "mode", "dmenu"); } else if(mode != NULL) { @@ -449,9 +455,15 @@ int main(int argc, char** argv) { if(prompt != NULL) { map_put(config, "prompt", prompt); } + if(map_get(config, "xoffset") != NULL) { + map_put(config, "x", map_get(config, "xoffset")); + } if(x != NULL) { map_put(config, "x", x); } + if(map_get(config, "yoffset") != NULL) { + map_put(config, "y", map_get(config, "yoffset")); + } if(y != NULL) { map_put(config, "y", y); } @@ -470,6 +482,9 @@ int main(int argc, char** argv) { if(terminal != NULL) { map_put(config, "term", terminal); } + if(map_get(config, "password") != NULL) { + map_put(config, "password_char", map_get(config, "password")); + } if(password_char == NULL || (password_char != NULL && strcmp(password_char, "false") != 0)) { if(password_char == NULL) { password_char = "*";