summaryrefslogtreecommitdiff
path: root/sway/commands/bar/wrap_scroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bar/wrap_scroll.c')
-rw-r--r--sway/commands/bar/wrap_scroll.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c
index 701de00a..04a4e6b8 100644
--- a/sway/commands/bar/wrap_scroll.c
+++ b/sway/commands/bar/wrap_scroll.c
@@ -2,6 +2,7 @@
#include <strings.h>
#include "sway/commands.h"
#include "log.h"
+#include "util.h"
struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
struct cmd_results *error = NULL;
@@ -11,17 +12,14 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
if (!config->current_bar) {
return cmd_results_new(CMD_FAILURE, "wrap_scroll", "No bar defined.");
}
- if (strcasecmp("yes", argv[0]) == 0) {
- config->current_bar->wrap_scroll = true;
+ config->current_bar->wrap_scroll =
+ parse_boolean(argv[0], config->current_bar->wrap_scroll);
+ if (config->current_bar->wrap_scroll) {
wlr_log(WLR_DEBUG, "Enabling wrap scroll on bar: %s",
- config->current_bar->id);
- } else if (strcasecmp("no", argv[0]) == 0) {
- config->current_bar->wrap_scroll = false;
+ config->current_bar->id);
+ } else {
wlr_log(WLR_DEBUG, "Disabling wrap scroll on bar: %s",
config->current_bar->id);
- } else {
- return cmd_results_new(CMD_INVALID,
- "wrap_scroll", "Invalid value %s", argv[0]);
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}