aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/seat
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-14 11:11:56 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-14 11:11:56 -0500
commit92fef27eaa0b52c9d37bdabff14ae21cd6660f46 (patch)
tree7a923bbbc233079006597d82721117bae88b6ac6 /sway/commands/seat
parentseat configuration (diff)
downloadsway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.tar.gz
sway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.tar.zst
sway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.zip
basic configuration
Diffstat (limited to 'sway/commands/seat')
-rw-r--r--sway/commands/seat/attach.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sway/commands/seat/attach.c b/sway/commands/seat/attach.c
new file mode 100644
index 00000000..996c1bda
--- /dev/null
+++ b/sway/commands/seat/attach.c
@@ -0,0 +1,26 @@
1#define _XOPEN_SOURCE 700
2#include <string.h>
3#include <strings.h>
4#include "sway/input/input-manager.h"
5#include "sway/commands.h"
6#include "sway/config.h"
7#include "log.h"
8#include "stringop.h"
9
10struct cmd_results *seat_cmd_attach(int argc, char **argv) {
11 struct cmd_results *error = NULL;
12 if ((error = checkarg(argc, "attach", EXPECTED_AT_LEAST, 1))) {
13 return error;
14 }
15 if (!current_seat_config) {
16 return cmd_results_new(CMD_FAILURE, "attach", "No seat defined");
17 }
18
19 struct seat_config *new_config = new_seat_config(current_seat_config->name);
20 struct seat_attachment_config *new_attachment = seat_attachment_config_new();
21 new_attachment->identifier = strdup(argv[0]);
22 list_add(new_config->attachments, new_attachment);
23
24 seat_cmd_apply(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26}