aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/seat
diff options
context:
space:
mode:
authorConnor E <38229097+c-edw@users.noreply.github.com>2018-11-10 12:55:06 +0000
committerConnor E <38229097+c-edw@users.noreply.github.com>2018-11-10 12:55:06 +0000
commitb865dabebab717fea75f91e8ccebabc99e36bdd9 (patch)
treedf51bf83b899933f1347508b9f1bd55aefa21ae5 /sway/commands/seat
parent7fa7f4f48d17e0470c800b258061d188ceb705da (diff)
Use parse_boolean where possible.
Diffstat (limited to 'sway/commands/seat')
-rw-r--r--sway/commands/seat/fallback.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sway/commands/seat/fallback.c b/sway/commands/seat/fallback.c
index 11f5a08c..a0ddf3ef 100644
--- a/sway/commands/seat/fallback.c
+++ b/sway/commands/seat/fallback.c
@@ -3,6 +3,7 @@
#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
+#include "util.h"
struct cmd_results *seat_cmd_fallback(int argc, char **argv) {
struct cmd_results *error = NULL;
@@ -16,16 +17,8 @@ struct cmd_results *seat_cmd_fallback(int argc, char **argv) {
}
struct seat_config *new_config =
new_seat_config(current_seat_config->name);
-
- if (strcasecmp(argv[0], "true") == 0) {
- new_config->fallback = 1;
- } else if (strcasecmp(argv[0], "false") == 0) {
- new_config->fallback = 0;
- } else {
- free_seat_config(new_config);
- return cmd_results_new(CMD_INVALID, "fallback",
- "Expected 'fallback <true|false>'");
- }
+
+ new_config->fallback = parse_boolean(argv[0], false);
if (!config->validating) {
apply_seat_config(new_config);