summaryrefslogtreecommitdiffstats
path: root/sway/commands/floating_modifier.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/floating_modifier.c')
-rw-r--r--sway/commands/floating_modifier.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sway/commands/floating_modifier.c b/sway/commands/floating_modifier.c
new file mode 100644
index 00000000..1ced50af
--- /dev/null
+++ b/sway/commands/floating_modifier.c
@@ -0,0 +1,30 @@
1#ifdef __linux__
2#include <linux/input-event-codes.h>
3#elif __FreeBSD__
4#include <dev/evdev/input-event-codes.h>
5#endif
6#include <xkbcommon/xkbcommon.h>
7#include <xkbcommon/xkbcommon-names.h>
8#include <strings.h>
9#include "sway/commands.h"
10#include "sway/config.h"
11#include "list.h"
12#include "log.h"
13#include "util.h"
14
15struct cmd_results *cmd_floating_modifier(int argc, char **argv) {
16 struct cmd_results *error = NULL;
17 if ((error = checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1))) {
18 return error;
19 }
20
21 uint32_t mod = get_modifier_mask_by_name(argv[0]);
22 if (!mod) {
23 return cmd_results_new(CMD_INVALID, "floating_modifier",
24 "Invalid modifier");
25 }
26
27 config->floating_mod = mod;
28
29 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
30}