diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/bar/font.c | 15 | ||||
-rw-r--r-- | sway/config/bar.c | 2 | ||||
-rw-r--r-- | sway/ipc-json.c | 4 |
3 files changed, 18 insertions, 3 deletions
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) { } char *font = join_args(argv, argc); free(config->current_bar->font); - config->current_bar->font = font; + + if (strncmp(font, "pango:", 6) == 0) { + if (config->current_bar->pango_markup == PANGO_MARKUP_DEFAULT) { + config->current_bar->pango_markup = true; + } + config->current_bar->font = strdup(font + 6); + } else { + if (config->current_bar->pango_markup == PANGO_MARKUP_DEFAULT) { + config->current_bar->pango_markup = false; + } + config->current_bar->font = strdup(font); + } + + free(font); sway_log(SWAY_DEBUG, "Settings font '%s' for bar: %s", config->current_bar->font, config->current_bar->id); return cmd_results_new(CMD_SUCCESS, NULL); diff --git a/sway/config/bar.c b/sway/config/bar.c index 767534a6..8970f3fd 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c @@ -91,7 +91,7 @@ struct bar_config *default_bar_config(void) { } bar->outputs = NULL; bar->position = strdup("bottom"); - bar->pango_markup = false; + bar->pango_markup = PANGO_MARKUP_DEFAULT; bar->swaybar_command = NULL; bar->font = NULL; bar->height = 0; diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 34adfc74..6c438424 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1127,7 +1127,9 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { json_object_object_add(json, "verbose", json_object_new_boolean(bar->verbose)); json_object_object_add(json, "pango_markup", - json_object_new_boolean(bar->pango_markup)); + json_object_new_boolean(bar->pango_markup == PANGO_MARKUP_DEFAULT + ? config->pango_markup + : bar->pango_markup)); json_object *colors = json_object_new_object(); json_object_object_add(colors, "background", |