diff options
author | 2017-11-18 11:22:02 -0500 | |
---|---|---|
committer | 2017-11-18 11:22:02 -0500 | |
commit | 733993a651c71f7e2198d505960d6bbd31e0e107 (patch) | |
tree | e51732c5872b624e73355f9e5b3f762101f3cd0d /sway/old/commands/bar/binding_mode_indicator.c | |
parent | Initial (awful) pass on xdg shell support (diff) | |
download | sway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.gz sway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.zst sway-733993a651c71f7e2198d505960d6bbd31e0e107.zip |
Move everything to sway/old/
Diffstat (limited to 'sway/old/commands/bar/binding_mode_indicator.c')
-rw-r--r-- | sway/old/commands/bar/binding_mode_indicator.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sway/old/commands/bar/binding_mode_indicator.c b/sway/old/commands/bar/binding_mode_indicator.c new file mode 100644 index 00000000..64f5b84f --- /dev/null +++ b/sway/old/commands/bar/binding_mode_indicator.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_binding_mode_indicator(int argc, char **argv) { | ||
7 | struct cmd_results *error = NULL; | ||
8 | if ((error = checkarg(argc, "binding_mode_indicator", EXPECTED_EQUAL_TO, 1))) { | ||
9 | return error; | ||
10 | } | ||
11 | |||
12 | if (!config->current_bar) { | ||
13 | return cmd_results_new(CMD_FAILURE, "binding_mode_indicator", "No bar defined."); | ||
14 | } | ||
15 | |||
16 | if (strcasecmp("yes", argv[0]) == 0) { | ||
17 | config->current_bar->binding_mode_indicator = true; | ||
18 | sway_log(L_DEBUG, "Enabling binding mode indicator on bar: %s", config->current_bar->id); | ||
19 | } else if (strcasecmp("no", argv[0]) == 0) { | ||
20 | config->current_bar->binding_mode_indicator = false; | ||
21 | sway_log(L_DEBUG, "Disabling binding mode indicator on bar: %s", config->current_bar->id); | ||
22 | } else { | ||
23 | error = cmd_results_new(CMD_INVALID, "binding_mode_indicator", "Invalid value %s", argv[0]); | ||
24 | return error; | ||
25 | } | ||
26 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
27 | } | ||