aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/seat
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-17 10:39:22 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-17 10:39:22 -0500
commit88bcd43ebf59cfa03a9e9a158c6f7a258c1f7db2 (patch)
tree4c2b9321ab9d5f7a9aeed35c7d6826c5da4e496f /sway/commands/seat
parentsend keyboard enter on keyboard configuration (diff)
downloadsway-88bcd43ebf59cfa03a9e9a158c6f7a258c1f7db2.tar.gz
sway-88bcd43ebf59cfa03a9e9a158c6f7a258c1f7db2.tar.zst
sway-88bcd43ebf59cfa03a9e9a158c6f7a258c1f7db2.zip
seat fallback config
Diffstat (limited to 'sway/commands/seat')
-rw-r--r--sway/commands/seat/fallback.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sway/commands/seat/fallback.c b/sway/commands/seat/fallback.c
new file mode 100644
index 00000000..7c129aae
--- /dev/null
+++ b/sway/commands/seat/fallback.c
@@ -0,0 +1,29 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/config.h"
4#include "sway/commands.h"
5#include "sway/input/input-manager.h"
6
7struct cmd_results *seat_cmd_fallback(int argc, char **argv) {
8 struct cmd_results *error = NULL;
9 if ((error = checkarg(argc, "fallback", EXPECTED_AT_LEAST, 1))) {
10 return error;
11 }
12 if (!current_seat_config) {
13 return cmd_results_new(CMD_FAILURE, "fallback", "No seat defined");
14 }
15 struct seat_config *new_config =
16 new_seat_config(current_seat_config->name);
17
18 if (strcasecmp(argv[0], "true") == 0) {
19 new_config->fallback = 1;
20 } else if (strcasecmp(argv[0], "false") == 0) {
21 new_config->fallback = 0;
22 } else {
23 return cmd_results_new(CMD_INVALID, "fallback",
24 "Expected 'fallback <true|false>'");
25 }
26
27 apply_seat_config(new_config);
28 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
29}