diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-11-03 08:32:10 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-03 08:32:10 -0600 |
commit | e9ac0492b7ec55d34d9209f2ff3e08de5c014d65 (patch) | |
tree | ee822e5e219275c84446709c349de630d7441055 /sway/config.c | |
parent | Log LD_LIBRARY_PATH (diff) | |
parent | swap unnecessary function for strndup (diff) | |
download | sway-e9ac0492b7ec55d34d9209f2ff3e08de5c014d65.tar.gz sway-e9ac0492b7ec55d34d9209f2ff3e08de5c014d65.tar.zst sway-e9ac0492b7ec55d34d9209f2ff3e08de5c014d65.zip |
Merge pull request #965 from thejan2009/swaybar-colours
Fix some colour settings in swaybar
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 63 |
1 files changed, 45 insertions, 18 deletions
diff --git a/sway/config.c b/sway/config.c index 7a41a3c8..7d5999d8 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -70,6 +70,28 @@ static void free_bar(struct bar_config *bar) { | |||
70 | terminate_swaybar(bar->pid); | 70 | terminate_swaybar(bar->pid); |
71 | } | 71 | } |
72 | 72 | ||
73 | free(bar->colors.background); | ||
74 | free(bar->colors.statusline); | ||
75 | free(bar->colors.separator); | ||
76 | free(bar->colors.focused_background); | ||
77 | free(bar->colors.focused_statusline); | ||
78 | free(bar->colors.focused_separator); | ||
79 | free(bar->colors.focused_workspace_border); | ||
80 | free(bar->colors.focused_workspace_bg); | ||
81 | free(bar->colors.focused_workspace_text); | ||
82 | free(bar->colors.active_workspace_border); | ||
83 | free(bar->colors.active_workspace_bg); | ||
84 | free(bar->colors.active_workspace_text); | ||
85 | free(bar->colors.inactive_workspace_border); | ||
86 | free(bar->colors.inactive_workspace_bg); | ||
87 | free(bar->colors.inactive_workspace_text); | ||
88 | free(bar->colors.urgent_workspace_border); | ||
89 | free(bar->colors.urgent_workspace_bg); | ||
90 | free(bar->colors.urgent_workspace_text); | ||
91 | free(bar->colors.binding_mode_border); | ||
92 | free(bar->colors.binding_mode_bg); | ||
93 | free(bar->colors.binding_mode_text); | ||
94 | |||
73 | free(bar); | 95 | free(bar); |
74 | } | 96 | } |
75 | 97 | ||
@@ -1132,24 +1154,29 @@ struct bar_config *default_bar_config(void) { | |||
1132 | bar->verbose = false; | 1154 | bar->verbose = false; |
1133 | bar->pid = 0; | 1155 | bar->pid = 0; |
1134 | // set default colors | 1156 | // set default colors |
1135 | strcpy(bar->colors.background, "#000000ff"); | 1157 | bar->colors.background = strndup("#000000ff", 9); |
1136 | strcpy(bar->colors.statusline, "#ffffffff"); | 1158 | bar->colors.statusline = strndup("#ffffffff", 9); |
1137 | strcpy(bar->colors.separator, "#666666ff"); | 1159 | bar->colors.separator = strndup("#666666ff", 9); |
1138 | strcpy(bar->colors.focused_workspace_border, "#4c7899ff"); | 1160 | bar->colors.focused_workspace_border = strndup("#4c7899ff", 9); |
1139 | strcpy(bar->colors.focused_workspace_bg, "#285577ff"); | 1161 | bar->colors.focused_workspace_bg = strndup("#285577ff", 9); |
1140 | strcpy(bar->colors.focused_workspace_text, "#ffffffff"); | 1162 | bar->colors.focused_workspace_text = strndup("#ffffffff", 9); |
1141 | strcpy(bar->colors.active_workspace_border, "#333333ff"); | 1163 | bar->colors.active_workspace_border = strndup("#333333ff", 9); |
1142 | strcpy(bar->colors.active_workspace_bg, "#5f676aff"); | 1164 | bar->colors.active_workspace_bg = strndup("#5f676aff", 9); |
1143 | strcpy(bar->colors.active_workspace_text, "#ffffffff"); | 1165 | bar->colors.active_workspace_text = strndup("#ffffffff", 9); |
1144 | strcpy(bar->colors.inactive_workspace_border, "#333333ff"); | 1166 | bar->colors.inactive_workspace_border = strndup("#333333ff", 9); |
1145 | strcpy(bar->colors.inactive_workspace_bg,"#222222ff"); | 1167 | bar->colors.inactive_workspace_bg = strndup("#222222ff", 9); |
1146 | strcpy(bar->colors.inactive_workspace_text, "#888888ff"); | 1168 | bar->colors.inactive_workspace_text = strndup("#888888ff", 9); |
1147 | strcpy(bar->colors.urgent_workspace_border, "#2f343aff"); | 1169 | bar->colors.urgent_workspace_border = strndup("#2f343aff", 9); |
1148 | strcpy(bar->colors.urgent_workspace_bg,"#900000ff"); | 1170 | bar->colors.urgent_workspace_bg = strndup("#900000ff", 9); |
1149 | strcpy(bar->colors.urgent_workspace_text, "#ffffffff"); | 1171 | bar->colors.urgent_workspace_text = strndup("#ffffffff", 9); |
1150 | strcpy(bar->colors.binding_mode_border, "#2f343aff"); | 1172 | // if the following colors stay undefined, they fall back to background, |
1151 | strcpy(bar->colors.binding_mode_bg,"#900000ff"); | 1173 | // statusline, separator and urgent_workspace_*. |
1152 | strcpy(bar->colors.binding_mode_text, "#ffffffff"); | 1174 | bar->colors.focused_background = NULL; |
1175 | bar->colors.focused_statusline = NULL; | ||
1176 | bar->colors.focused_separator = NULL; | ||
1177 | bar->colors.binding_mode_border = NULL; | ||
1178 | bar->colors.binding_mode_bg = NULL; | ||
1179 | bar->colors.binding_mode_text = NULL; | ||
1153 | 1180 | ||
1154 | list_add(config->bars, bar); | 1181 | list_add(config->bars, bar); |
1155 | 1182 | ||