diff options
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/config.c | 1 | ||||
-rw-r--r-- | swaybar/ipc.c | 6 | ||||
-rw-r--r-- | swaybar/render.c | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/swaybar/config.c b/swaybar/config.c index 6b9ff86b..7bd22c91 100644 --- a/swaybar/config.c +++ b/swaybar/config.c @@ -46,6 +46,7 @@ char *parse_font(const char *font) { struct config *init_config() { struct config *config = calloc(1, sizeof(struct config)); config->status_command = NULL; + config->pango_markup = true; config->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM; config->font = strdup("monospace 10"); config->mode = NULL; diff --git a/swaybar/ipc.c b/swaybar/ipc.c index 312c79b9..dacee4c2 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -12,6 +12,7 @@ static void ipc_parse_config(struct config *config, const char *payload) { json_object *tray_output, *mode, *hidden_bar, *position, *status_command; json_object *font, *bar_height, *workspace_buttons, *strip_workspace_numbers; json_object *binding_mode_indicator, *verbose, *colors, *sep_symbol, *outputs; + json_object *markup; json_object_object_get_ex(bar_config, "tray_output", &tray_output); json_object_object_get_ex(bar_config, "mode", &mode); json_object_object_get_ex(bar_config, "hidden_bar", &hidden_bar); @@ -26,6 +27,7 @@ static void ipc_parse_config(struct config *config, const char *payload) { json_object_object_get_ex(bar_config, "separator_symbol", &sep_symbol); json_object_object_get_ex(bar_config, "colors", &colors); json_object_object_get_ex(bar_config, "outputs", &outputs); + json_object_object_get_ex(bar_config, "pango_markup", &markup); if (status_command) { free(config->status_command); @@ -62,6 +64,10 @@ static void ipc_parse_config(struct config *config, const char *payload) { config->height = json_object_get_int(bar_height); } + if (markup) { + config->pango_markup = json_object_get_boolean(markup); + } + // free previous outputs list int i; for (i = 0; i < config->outputs->length; ++i) { diff --git a/swaybar/render.c b/swaybar/render.c index 5901b557..273bd4f0 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -278,9 +278,9 @@ void render(struct output *output, struct config *config, struct status_line *li int width, height; if (line->protocol == TEXT) { - get_text_size(window->cairo, window->font, &width, &height, true, "%s", line->text_line); + get_text_size(window->cairo, window->font, &width, &height, config->pango_markup, "%s", line->text_line); cairo_move_to(cairo, window->width - margin - width, margin); - pango_printf(window->cairo, window->font, true, "%s", line->text_line); + pango_printf(window->cairo, window->font, config->pango_markup, "%s", line->text_line); } else if (line->protocol == I3BAR && line->block_line) { double pos = window->width - 0.5; bool edge = true; |