diff options
Diffstat (limited to 'sway/commands/bar/pango_markup.c')
-rw-r--r-- | sway/commands/bar/pango_markup.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sway/commands/bar/pango_markup.c b/sway/commands/bar/pango_markup.c index 857571fb..d57cc45c 100644 --- a/sway/commands/bar/pango_markup.c +++ b/sway/commands/bar/pango_markup.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <strings.h> | 2 | #include <strings.h> |
3 | #include "sway/commands.h" | 3 | #include "sway/commands.h" |
4 | #include "log.h" | 4 | #include "log.h" |
5 | #include "util.h" | ||
5 | 6 | ||
6 | struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) { | 7 | struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) { |
7 | struct cmd_results *error = NULL; | 8 | struct cmd_results *error = NULL; |
@@ -11,18 +12,14 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) { | |||
11 | if (!config->current_bar) { | 12 | if (!config->current_bar) { |
12 | return cmd_results_new(CMD_FAILURE, "pango_markup", "No bar defined."); | 13 | return cmd_results_new(CMD_FAILURE, "pango_markup", "No bar defined."); |
13 | } | 14 | } |
14 | if (strcasecmp("enabled", argv[0]) == 0) { | 15 | config->current_bar->pango_markup |
15 | config->current_bar->pango_markup = true; | 16 | = parse_boolean(argv[0], config->current_bar->pango_markup); |
17 | if (config->current_bar->pango_markup) { | ||
16 | wlr_log(WLR_DEBUG, "Enabling pango markup for bar: %s", | 18 | wlr_log(WLR_DEBUG, "Enabling pango markup for bar: %s", |
17 | config->current_bar->id); | 19 | config->current_bar->id); |
18 | } else if (strcasecmp("disabled", argv[0]) == 0) { | 20 | } else { |
19 | config->current_bar->pango_markup = false; | ||
20 | wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s", | 21 | wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s", |
21 | config->current_bar->id); | 22 | config->current_bar->id); |
22 | } else { | ||
23 | error = cmd_results_new(CMD_INVALID, "pango_markup", | ||
24 | "Invalid value %s", argv[0]); | ||
25 | return error; | ||
26 | } | 23 | } |
27 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
28 | } | 25 | } |