aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/bar/pango_markup.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bar/pango_markup.c')
-rw-r--r--sway/commands/bar/pango_markup.c13
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 @@
#include <strings.h>
#include "sway/commands.h"
#include "log.h"
+#include "util.h"
struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
struct cmd_results *error = NULL;
@@ -11,18 +12,14 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
if (!config->current_bar) {
return cmd_results_new(CMD_FAILURE, "pango_markup", "No bar defined.");
}
- if (strcasecmp("enabled", argv[0]) == 0) {
- config->current_bar->pango_markup = true;
+ config->current_bar->pango_markup
+ = parse_boolean(argv[0], config->current_bar->pango_markup);
+ if (config->current_bar->pango_markup) {
wlr_log(WLR_DEBUG, "Enabling pango markup for bar: %s",
config->current_bar->id);
- } else if (strcasecmp("disabled", argv[0]) == 0) {
- config->current_bar->pango_markup = false;
+ } else {
wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s",
config->current_bar->id);
- } else {
- error = cmd_results_new(CMD_INVALID, "pango_markup",
- "Invalid value %s", argv[0]);
- return error;
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}