diff options
author | Connor E <38229097+c-edw@users.noreply.github.com> | 2018-11-10 12:55:06 +0000 |
---|---|---|
committer | Connor E <38229097+c-edw@users.noreply.github.com> | 2018-11-10 12:55:06 +0000 |
commit | b865dabebab717fea75f91e8ccebabc99e36bdd9 (patch) | |
tree | df51bf83b899933f1347508b9f1bd55aefa21ae5 /sway/commands/input/xkb_capslock.c | |
parent | Merge pull request #3085 from 7415963987456321/master (diff) | |
download | sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.gz sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.zst sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.zip |
Use parse_boolean where possible.
Diffstat (limited to 'sway/commands/input/xkb_capslock.c')
-rw-r--r-- | sway/commands/input/xkb_capslock.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sway/commands/input/xkb_capslock.c b/sway/commands/input/xkb_capslock.c index 669b4ea9..a939c72f 100644 --- a/sway/commands/input/xkb_capslock.c +++ b/sway/commands/input/xkb_capslock.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "sway/config.h" | 3 | #include "sway/config.h" |
4 | #include "sway/commands.h" | 4 | #include "sway/commands.h" |
5 | #include "sway/input/input-manager.h" | 5 | #include "sway/input/input-manager.h" |
6 | #include "util.h" | ||
6 | 7 | ||
7 | struct cmd_results *input_cmd_xkb_capslock(int argc, char **argv) { | 8 | struct cmd_results *input_cmd_xkb_capslock(int argc, char **argv) { |
8 | struct cmd_results *error = NULL; | 9 | struct cmd_results *error = NULL; |
@@ -15,14 +16,7 @@ struct cmd_results *input_cmd_xkb_capslock(int argc, char **argv) { | |||
15 | "No input device defined."); | 16 | "No input device defined."); |
16 | } | 17 | } |
17 | 18 | ||
18 | if (strcasecmp(argv[0], "enabled") == 0) { | 19 | ic->xkb_capslock = parse_boolean(argv[0], false); |
19 | ic->xkb_capslock = 1; | ||
20 | } else if (strcasecmp(argv[0], "disabled") == 0) { | ||
21 | ic->xkb_capslock = 0; | ||
22 | } else { | ||
23 | return cmd_results_new(CMD_INVALID, "xkb_capslock", | ||
24 | "Expected 'xkb_capslock <enabled|disabled>'"); | ||
25 | } | ||
26 | 20 | ||
27 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 21 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
28 | } | 22 | } |