diff options
author | D.B <thejan.2009@gmail.com> | 2016-11-02 18:48:43 +0100 |
---|---|---|
committer | D.B <thejan.2009@gmail.com> | 2016-11-02 18:58:33 +0100 |
commit | ad4d21d60b36ba39e2090fa052a29bf7ea8a3395 (patch) | |
tree | 84cb01165960555dbc64cd8aa57137b43ff65655 /sway/ipc-json.c | |
parent | use urgent_ws color in swaybar if binding_mode is undefined (diff) | |
download | sway-ad4d21d60b36ba39e2090fa052a29bf7ea8a3395.tar.gz sway-ad4d21d60b36ba39e2090fa052a29bf7ea8a3395.tar.zst sway-ad4d21d60b36ba39e2090fa052a29bf7ea8a3395.zip |
add bar colours for focused_(workspace|statusline|separator)
If these aren't defined in config, color settings without 'focused_'
prefix are used as a fallback.
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 458dc7c2..c21d28af 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -312,6 +312,24 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { | |||
312 | json_object_object_add(colors, "statusline", json_object_new_string(bar->colors.statusline)); | 312 | json_object_object_add(colors, "statusline", json_object_new_string(bar->colors.statusline)); |
313 | json_object_object_add(colors, "separator", json_object_new_string(bar->colors.separator)); | 313 | json_object_object_add(colors, "separator", json_object_new_string(bar->colors.separator)); |
314 | 314 | ||
315 | if (bar->colors.has_focused_background) { | ||
316 | json_object_object_add(colors, "focused_background", json_object_new_string(bar->colors.focused_background)); | ||
317 | } else { | ||
318 | json_object_object_add(colors, "focused_background", json_object_new_string(bar->colors.background)); | ||
319 | } | ||
320 | |||
321 | if (bar->colors.has_focused_statusline) { | ||
322 | json_object_object_add(colors, "focused_statusline", json_object_new_string(bar->colors.focused_statusline)); | ||
323 | } else { | ||
324 | json_object_object_add(colors, "focused_statusline", json_object_new_string(bar->colors.statusline)); | ||
325 | } | ||
326 | |||
327 | if (bar->colors.has_focused_separator) { | ||
328 | json_object_object_add(colors, "focused_separator", json_object_new_string(bar->colors.focused_separator)); | ||
329 | } else { | ||
330 | json_object_object_add(colors, "focused_separator", json_object_new_string(bar->colors.separator)); | ||
331 | } | ||
332 | |||
315 | json_object_object_add(colors, "focused_workspace_border", json_object_new_string(bar->colors.focused_workspace_border)); | 333 | json_object_object_add(colors, "focused_workspace_border", json_object_new_string(bar->colors.focused_workspace_border)); |
316 | json_object_object_add(colors, "focused_workspace_bg", json_object_new_string(bar->colors.focused_workspace_bg)); | 334 | json_object_object_add(colors, "focused_workspace_bg", json_object_new_string(bar->colors.focused_workspace_bg)); |
317 | json_object_object_add(colors, "focused_workspace_text", json_object_new_string(bar->colors.focused_workspace_text)); | 335 | json_object_object_add(colors, "focused_workspace_text", json_object_new_string(bar->colors.focused_workspace_text)); |