diff options
Diffstat (limited to 'sway/commands/bar')
-rw-r--r-- | sway/commands/bar/colors.c | 2 | ||||
-rw-r--r-- | sway/commands/bar/font.c | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/sway/commands/bar/colors.c b/sway/commands/bar/colors.c index 2d5b22bf..275fa3c6 100644 --- a/sway/commands/bar/colors.c +++ b/sway/commands/bar/colors.c | |||
@@ -4,7 +4,7 @@ | |||
4 | #include "util.h" | 4 | #include "util.h" |
5 | 5 | ||
6 | // Must be in alphabetical order for bsearch | 6 | // Must be in alphabetical order for bsearch |
7 | static struct cmd_handler bar_colors_handlers[] = { | 7 | static const struct cmd_handler bar_colors_handlers[] = { |
8 | { "active_workspace", bar_colors_cmd_active_workspace }, | 8 | { "active_workspace", bar_colors_cmd_active_workspace }, |
9 | { "background", bar_colors_cmd_background }, | 9 | { "background", bar_colors_cmd_background }, |
10 | { "binding_mode", bar_colors_cmd_binding_mode }, | 10 | { "binding_mode", bar_colors_cmd_binding_mode }, |
diff --git a/sway/commands/bar/font.c b/sway/commands/bar/font.c index 62987f3e..891c87af 100644 --- a/sway/commands/bar/font.c +++ b/sway/commands/bar/font.c | |||
@@ -11,7 +11,20 @@ struct cmd_results *bar_cmd_font(int argc, char **argv) { | |||
11 | } | 11 | } |
12 | char *font = join_args(argv, argc); | 12 | char *font = join_args(argv, argc); |
13 | free(config->current_bar->font); | 13 | free(config->current_bar->font); |
14 | config->current_bar->font = font; | 14 | |
15 | if (strncmp(font, "pango:", 6) == 0) { | ||
16 | if (config->current_bar->pango_markup == PANGO_MARKUP_DEFAULT) { | ||
17 | config->current_bar->pango_markup = true; | ||
18 | } | ||
19 | config->current_bar->font = strdup(font + 6); | ||
20 | } else { | ||
21 | if (config->current_bar->pango_markup == PANGO_MARKUP_DEFAULT) { | ||
22 | config->current_bar->pango_markup = false; | ||
23 | } | ||
24 | config->current_bar->font = strdup(font); | ||
25 | } | ||
26 | |||
27 | free(font); | ||
15 | sway_log(SWAY_DEBUG, "Settings font '%s' for bar: %s", | 28 | sway_log(SWAY_DEBUG, "Settings font '%s' for bar: %s", |
16 | config->current_bar->font, config->current_bar->id); | 29 | config->current_bar->font, config->current_bar->id); |
17 | return cmd_results_new(CMD_SUCCESS, NULL); | 30 | return cmd_results_new(CMD_SUCCESS, NULL); |