aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bar/wrap_scroll.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 22:05:16 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 22:11:08 -0400
commit741424c4e7811c12d8cca28466f89bd61eaf3a75 (patch)
tree37af2aa063d42bf6ef3bc967bb1a5b6b679abbaf /sway/commands/bar/wrap_scroll.c
parentUse statically allocated text buffer (diff)
downloadsway-741424c4e7811c12d8cca28466f89bd61eaf3a75.tar.gz
sway-741424c4e7811c12d8cca28466f89bd61eaf3a75.tar.zst
sway-741424c4e7811c12d8cca28466f89bd61eaf3a75.zip
Clean up imported bar commands
Diffstat (limited to 'sway/commands/bar/wrap_scroll.c')
-rw-r--r--sway/commands/bar/wrap_scroll.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c
index c89dff5f..7386f82c 100644
--- a/sway/commands/bar/wrap_scroll.c
+++ b/sway/commands/bar/wrap_scroll.c
@@ -8,20 +8,20 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
8 if ((error = checkarg(argc, "wrap_scroll", EXPECTED_EQUAL_TO, 1))) { 8 if ((error = checkarg(argc, "wrap_scroll", EXPECTED_EQUAL_TO, 1))) {
9 return error; 9 return error;
10 } 10 }
11
12 if (!config->current_bar) { 11 if (!config->current_bar) {
13 return cmd_results_new(CMD_FAILURE, "wrap_scroll", "No bar defined."); 12 return cmd_results_new(CMD_FAILURE, "wrap_scroll", "No bar defined.");
14 } 13 }
15
16 if (strcasecmp("yes", argv[0]) == 0) { 14 if (strcasecmp("yes", argv[0]) == 0) {
17 config->current_bar->wrap_scroll = true; 15 config->current_bar->wrap_scroll = true;
18 wlr_log(L_DEBUG, "Enabling wrap scroll on bar: %s", config->current_bar->id); 16 wlr_log(L_DEBUG, "Enabling wrap scroll on bar: %s",
17 config->current_bar->id);
19 } else if (strcasecmp("no", argv[0]) == 0) { 18 } else if (strcasecmp("no", argv[0]) == 0) {
20 config->current_bar->wrap_scroll = false; 19 config->current_bar->wrap_scroll = false;
21 wlr_log(L_DEBUG, "Disabling wrap scroll on bar: %s", config->current_bar->id); 20 wlr_log(L_DEBUG, "Disabling wrap scroll on bar: %s",
21 config->current_bar->id);
22 } else { 22 } else {
23 error = cmd_results_new(CMD_INVALID, "wrap_scroll", "Invalid value %s", argv[0]); 23 return cmd_results_new(CMD_INVALID,
24 return error; 24 "wrap_scroll", "Invalid value %s", argv[0]);
25 } 25 }
26 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 26 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
27} 27}