diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-12 10:55:20 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-12 10:55:20 -0500 |
commit | c173d30b9203520c274f34eb72fc787aa33ca211 (patch) | |
tree | 11a1090e2e582caf1c19521596925ed14e57a6e4 /sway/commands/input | |
parent | config cleanup (diff) | |
download | sway-c173d30b9203520c274f34eb72fc787aa33ca211.tar.gz sway-c173d30b9203520c274f34eb72fc787aa33ca211.tar.zst sway-c173d30b9203520c274f34eb72fc787aa33ca211.zip |
seat configuration
Diffstat (limited to 'sway/commands/input')
-rw-r--r-- | sway/commands/input/seat.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sway/commands/input/seat.c b/sway/commands/input/seat.c new file mode 100644 index 00000000..9d86ac0e --- /dev/null +++ b/sway/commands/input/seat.c | |||
@@ -0,0 +1,28 @@ | |||
1 | #define _XOPEN_SOURCE 700 | ||
2 | #include <string.h> | ||
3 | #include <strings.h> | ||
4 | #include "sway/commands.h" | ||
5 | #include "sway/input/input-manager.h" | ||
6 | #include "log.h" | ||
7 | |||
8 | struct cmd_results *input_cmd_seat(int argc, char **argv) { | ||
9 | sway_log(L_DEBUG, "seat for device: %d %s", | ||
10 | current_input_config==NULL, current_input_config->identifier); | ||
11 | struct cmd_results *error = NULL; | ||
12 | if ((error = checkarg(argc, "seat", EXPECTED_AT_LEAST, 1))) { | ||
13 | return error; | ||
14 | } | ||
15 | if (!current_input_config) { | ||
16 | return cmd_results_new(CMD_FAILURE, "seat", | ||
17 | "No input device defined."); | ||
18 | } | ||
19 | struct input_config *new_config = | ||
20 | new_input_config(current_input_config->identifier); | ||
21 | |||
22 | // TODO validate seat name | ||
23 | free(new_config->seat); | ||
24 | new_config->seat = strdup(argv[0]); | ||
25 | |||
26 | input_cmd_apply(new_config); | ||
27 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
28 | } | ||