There are now secondary config options that match the command line flags if the original options didn't
This commit is contained in:
parent
8093c05fe1
commit
2d08672f86
15
src/main.c
15
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 = "*";
|
||||
|
Loading…
Reference in New Issue
Block a user