From 39ee0ec552c05c7ab5031982a1104a0bae1910d3 Mon Sep 17 00:00:00 2001 From: "D.B" Date: Wed, 2 Nov 2016 17:09:34 +0100 Subject: use urgent_ws color in swaybar if binding_mode is undefined --- include/sway/config.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/sway/config.h b/include/sway/config.h index a14b7e48..c41bb8b3 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -163,6 +163,10 @@ struct bar_config { char binding_mode_border[10]; char binding_mode_bg[10]; char binding_mode_text[10]; + + bool has_binding_mode_border; + bool has_binding_mode_bg; + bool has_binding_mode_text; } colors; }; -- cgit v1.2.3 From ad4d21d60b36ba39e2090fa052a29bf7ea8a3395 Mon Sep 17 00:00:00 2001 From: "D.B" Date: Wed, 2 Nov 2016 18:48:43 +0100 Subject: 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. --- include/sway/commands.h | 4 +++- include/sway/config.h | 7 +++++++ include/swaybar/bar.h | 2 ++ include/swaybar/config.h | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sway/commands.h b/include/sway/commands.h index a46f41a3..db5e94d9 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -160,12 +160,14 @@ sway_cmd bar_cmd_workspace_buttons; sway_cmd bar_colors_cmd_active_workspace; sway_cmd bar_colors_cmd_background; -sway_cmd bar_colors_cmd_background; +sway_cmd bar_colors_cmd_focused_background; sway_cmd bar_colors_cmd_binding_mode; sway_cmd bar_colors_cmd_focused_workspace; sway_cmd bar_colors_cmd_inactive_workspace; sway_cmd bar_colors_cmd_separator; +sway_cmd bar_colors_cmd_focused_separator; sway_cmd bar_colors_cmd_statusline; +sway_cmd bar_colors_cmd_focused_statusline; sway_cmd bar_colors_cmd_urgent_workspace; sway_cmd input_cmd_accel_profile; diff --git a/include/sway/config.h b/include/sway/config.h index c41bb8b3..9b3cc60c 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -148,6 +148,9 @@ struct bar_config { char background[10]; char statusline[10]; char separator[10]; + char focused_background[10]; + char focused_statusline[10]; + char focused_separator[10]; char focused_workspace_border[10]; char focused_workspace_bg[10]; char focused_workspace_text[10]; @@ -164,6 +167,10 @@ struct bar_config { char binding_mode_bg[10]; char binding_mode_text[10]; + bool has_focused_background; + bool has_focused_statusline; + bool has_focused_separator; + bool has_binding_mode_border; bool has_binding_mode_bg; bool has_binding_mode_text; diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index a3c511d9..697a48c2 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h @@ -9,6 +9,7 @@ struct bar { struct config *config; struct status_line *status; list_t *outputs; + struct output *focused_output; int ipc_event_socketfd; int ipc_socketfd; @@ -22,6 +23,7 @@ struct output { list_t *workspaces; char *name; int idx; + bool focused; }; struct workspace { diff --git a/include/swaybar/config.h b/include/swaybar/config.h index 934116ca..04b12cd4 100644 --- a/include/swaybar/config.h +++ b/include/swaybar/config.h @@ -40,6 +40,10 @@ struct config { uint32_t statusline; uint32_t separator; + uint32_t focused_background; + uint32_t focused_statusline; + uint32_t focused_separator; + struct box_colors focused_workspace; struct box_colors active_workspace; struct box_colors inactive_workspace; -- cgit v1.2.3 From 58eb7ac19fe436737babcbd1effd41ef96af6632 Mon Sep 17 00:00:00 2001 From: "D.B" Date: Wed, 2 Nov 2016 21:07:04 +0100 Subject: change bar colors from char[10] to *char This commit removes has_* booleans from bar color struct. It also generalizes of functions in commands/bar/colors.c. --- include/sway/config.h | 50 +++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'include') diff --git a/include/sway/config.h b/include/sway/config.h index 9b3cc60c..8d077ee7 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -145,35 +145,27 @@ struct bar_config { bool verbose; pid_t pid; struct { - char background[10]; - char statusline[10]; - char separator[10]; - char focused_background[10]; - char focused_statusline[10]; - char focused_separator[10]; - char focused_workspace_border[10]; - char focused_workspace_bg[10]; - char focused_workspace_text[10]; - char active_workspace_border[10]; - char active_workspace_bg[10]; - char active_workspace_text[10]; - char inactive_workspace_border[10]; - char inactive_workspace_bg[10]; - char inactive_workspace_text[10]; - char urgent_workspace_border[10]; - char urgent_workspace_bg[10]; - char urgent_workspace_text[10]; - char binding_mode_border[10]; - char binding_mode_bg[10]; - char binding_mode_text[10]; - - bool has_focused_background; - bool has_focused_statusline; - bool has_focused_separator; - - bool has_binding_mode_border; - bool has_binding_mode_bg; - bool has_binding_mode_text; + char *background; + char *statusline; + char *separator; + char *focused_background; + char *focused_statusline; + char *focused_separator; + char *focused_workspace_border; + char *focused_workspace_bg; + char *focused_workspace_text; + char *active_workspace_border; + char *active_workspace_bg; + char *active_workspace_text; + char *inactive_workspace_border; + char *inactive_workspace_bg; + char *inactive_workspace_text; + char *urgent_workspace_border; + char *urgent_workspace_bg; + char *urgent_workspace_text; + char *binding_mode_border; + char *binding_mode_bg; + char *binding_mode_text; } colors; }; -- cgit v1.2.3