diff options
author | D.B <thejan.2009@gmail.com> | 2016-11-02 17:09:34 +0100 |
---|---|---|
committer | D.B <thejan.2009@gmail.com> | 2016-11-02 18:58:33 +0100 |
commit | 39ee0ec552c05c7ab5031982a1104a0bae1910d3 (patch) | |
tree | daaf306035c7e925e3ca0bc7867a6b6249a60b42 /sway/ipc-json.c | |
parent | Log LD_LIBRARY_PATH (diff) | |
download | sway-39ee0ec552c05c7ab5031982a1104a0bae1910d3.tar.gz sway-39ee0ec552c05c7ab5031982a1104a0bae1910d3.tar.zst sway-39ee0ec552c05c7ab5031982a1104a0bae1910d3.zip |
use urgent_ws color in swaybar if binding_mode is undefined
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index eb77a654..458dc7c2 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -328,9 +328,23 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { | |||
328 | json_object_object_add(colors, "urgent_workspace_bg", json_object_new_string(bar->colors.urgent_workspace_bg)); | 328 | json_object_object_add(colors, "urgent_workspace_bg", json_object_new_string(bar->colors.urgent_workspace_bg)); |
329 | json_object_object_add(colors, "urgent_workspace_text", json_object_new_string(bar->colors.urgent_workspace_text)); | 329 | json_object_object_add(colors, "urgent_workspace_text", json_object_new_string(bar->colors.urgent_workspace_text)); |
330 | 330 | ||
331 | json_object_object_add(colors, "binding_mode_border", json_object_new_string(bar->colors.binding_mode_border)); | 331 | if (bar->colors.has_binding_mode_border) { |
332 | json_object_object_add(colors, "binding_mode_bg", json_object_new_string(bar->colors.binding_mode_bg)); | 332 | json_object_object_add(colors, "binding_mode_border", json_object_new_string(bar->colors.binding_mode_border)); |
333 | json_object_object_add(colors, "binding_mode_text", json_object_new_string(bar->colors.binding_mode_text)); | 333 | } else { |
334 | json_object_object_add(colors, "binding_mode_border", json_object_new_string(bar->colors.urgent_workspace_border)); | ||
335 | } | ||
336 | |||
337 | if (bar->colors.has_binding_mode_bg) { | ||
338 | json_object_object_add(colors, "binding_mode_bg", json_object_new_string(bar->colors.binding_mode_bg)); | ||
339 | } else { | ||
340 | json_object_object_add(colors, "binding_mode_bg", json_object_new_string(bar->colors.urgent_workspace_bg)); | ||
341 | } | ||
342 | |||
343 | if (bar->colors.has_binding_mode_text) { | ||
344 | json_object_object_add(colors, "binding_mode_text", json_object_new_string(bar->colors.binding_mode_text)); | ||
345 | } else { | ||
346 | json_object_object_add(colors, "binding_mode_text", json_object_new_string(bar->colors.urgent_workspace_text)); | ||
347 | } | ||
334 | 348 | ||
335 | json_object_object_add(json, "colors", colors); | 349 | json_object_object_add(json, "colors", colors); |
336 | 350 | ||