mirror of
https://github.com/swaywm/sway.git
synced 2025-11-09 13:29:49 -05:00
Implement bar option: colors {}
This commit is contained in:
parent
cfba09a4ac
commit
8c1d56812b
3 changed files with 264 additions and 12 deletions
|
|
@ -263,6 +263,14 @@ bool read_config(FILE *file, bool is_active) {
|
|||
}
|
||||
break;
|
||||
|
||||
case CMD_BLOCK_BAR_COLORS:
|
||||
if (block == CMD_BLOCK_BAR) {
|
||||
block = CMD_BLOCK_BAR_COLORS;
|
||||
} else {
|
||||
sway_log(L_ERROR, "Invalid block '%s'", line);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMD_BLOCK_END:
|
||||
switch(block) {
|
||||
case CMD_BLOCK_MODE:
|
||||
|
|
@ -277,6 +285,11 @@ bool read_config(FILE *file, bool is_active) {
|
|||
block = CMD_BLOCK_END;
|
||||
break;
|
||||
|
||||
case CMD_BLOCK_BAR_COLORS:
|
||||
sway_log(L_DEBUG, "End of bar colors block");
|
||||
block = CMD_BLOCK_BAR;
|
||||
break;
|
||||
|
||||
case CMD_BLOCK_END:
|
||||
sway_log(L_ERROR, "Unmatched }");
|
||||
break;
|
||||
|
|
@ -554,6 +567,26 @@ struct bar_config *default_bar_config(void) {
|
|||
bar->strip_workspace_numbers = false;
|
||||
bar->binding_mode_indicator = true;
|
||||
bar->tray_padding = 2;
|
||||
// set default colors
|
||||
strcpy(bar->colors.background, "#000000");
|
||||
strcpy(bar->colors.statusline, "#ffffff");
|
||||
strcpy(bar->colors.separator, "#666666");
|
||||
strcpy(bar->colors.focused_workspace_border, "#4c7899");
|
||||
strcpy(bar->colors.focused_workspace_bg, "#285577");
|
||||
strcpy(bar->colors.focused_workspace_text, "#ffffff");
|
||||
strcpy(bar->colors.active_workspace_border, "333333");
|
||||
strcpy(bar->colors.active_workspace_bg, "#5f676a");
|
||||
strcpy(bar->colors.active_workspace_text, "#ffffff");
|
||||
strcpy(bar->colors.inactive_workspace_border, "#333333");
|
||||
strcpy(bar->colors.inactive_workspace_bg,"#222222");
|
||||
strcpy(bar->colors.inactive_workspace_text, "#888888");
|
||||
strcpy(bar->colors.urgent_workspace_border, "#2f343a");
|
||||
strcpy(bar->colors.urgent_workspace_bg,"#900000");
|
||||
strcpy(bar->colors.urgent_workspace_text, "#ffffff");
|
||||
strcpy(bar->colors.binding_mode_border, "#2f343a");
|
||||
strcpy(bar->colors.binding_mode_bg,"#900000");
|
||||
strcpy(bar->colors.binding_mode_text, "#ffffff");
|
||||
|
||||
list_add(config->bars, bar);
|
||||
|
||||
return bar;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue