diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-02-23 15:06:04 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-02-27 22:12:35 +0100 |
commit | e4c1176b726ab9391a3c9eb69670c09ffe3e4f0a (patch) | |
tree | 3eacdd14c2eb49826c56de8ddb7dbaf67720e59e /swaybar | |
parent | 212c6a18a2003f61bbbd7b6f4a881610e31b0c53 (diff) |
Differentiate between all or no outputs
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/config.c | 1 | ||||
-rw-r--r-- | swaybar/ipc.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/swaybar/config.c b/swaybar/config.c index 5609f85f..fddea791 100644 --- a/swaybar/config.c +++ b/swaybar/config.c @@ -51,6 +51,7 @@ struct config *init_config() { config->strip_workspace_numbers = false; config->binding_mode_indicator = true; config->workspace_buttons = true; + config->all_outputs = false; config->outputs = create_list(); /* height */ diff --git a/swaybar/ipc.c b/swaybar/ipc.c index b5ae6747..312c79b9 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -78,10 +78,13 @@ static void ipc_parse_config(struct config *config, const char *payload) { output = json_object_array_get_idx(outputs, i); output_str = json_object_get_string(output); if (strcmp("*", output_str) == 0) { + config->all_outputs = true; break; } list_add(config->outputs, strdup(output_str)); } + } else { + config->all_outputs = true; } if (colors) { @@ -251,7 +254,7 @@ void ipc_bar_init(struct bar *bar, const char *bar_id) { } bool use_output = false; - if (bar->config->outputs->length == 0) { + if (bar->config->all_outputs) { use_output = true; } else { int j = 0; |