diff options
author | 2018-03-29 17:20:03 -0400 | |
---|---|---|
committer | 2018-03-29 22:11:08 -0400 | |
commit | bf7a4cd0ebd465a0597e9eec0142fad222b396de (patch) | |
tree | f95c4b8cd8e7d06eaa1b688d3bcbb3249dc21129 /sway/commands/bar/wrap_scroll.c | |
parent | Implement enough IPC for swaybar to work (diff) | |
download | sway-bf7a4cd0ebd465a0597e9eec0142fad222b396de.tar.gz sway-bf7a4cd0ebd465a0597e9eec0142fad222b396de.tar.zst sway-bf7a4cd0ebd465a0597e9eec0142fad222b396de.zip |
Add bar configuration commands
Diffstat (limited to 'sway/commands/bar/wrap_scroll.c')
-rw-r--r-- | sway/commands/bar/wrap_scroll.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c new file mode 100644 index 00000000..c89dff5f --- /dev/null +++ b/sway/commands/bar/wrap_scroll.c | |||
@@ -0,0 +1,27 @@ | |||
1 | #include <string.h> | ||
2 | #include <strings.h> | ||
3 | #include "sway/commands.h" | ||
4 | #include "log.h" | ||
5 | |||
6 | struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) { | ||
7 | struct cmd_results *error = NULL; | ||
8 | if ((error = checkarg(argc, "wrap_scroll", EXPECTED_EQUAL_TO, 1))) { | ||
9 | return error; | ||
10 | } | ||
11 | |||
12 | if (!config->current_bar) { | ||
13 | return cmd_results_new(CMD_FAILURE, "wrap_scroll", "No bar defined."); | ||
14 | } | ||
15 | |||
16 | if (strcasecmp("yes", argv[0]) == 0) { | ||
17 | config->current_bar->wrap_scroll = true; | ||
18 | wlr_log(L_DEBUG, "Enabling wrap scroll on bar: %s", config->current_bar->id); | ||
19 | } else if (strcasecmp("no", argv[0]) == 0) { | ||
20 | config->current_bar->wrap_scroll = false; | ||
21 | wlr_log(L_DEBUG, "Disabling wrap scroll on bar: %s", config->current_bar->id); | ||
22 | } else { | ||
23 | error = cmd_results_new(CMD_INVALID, "wrap_scroll", "Invalid value %s", argv[0]); | ||
24 | return error; | ||
25 | } | ||
26 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
27 | } | ||