aboutsummaryrefslogtreecommitdiffstats
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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/commands/floating_modifier.c b/sway/commands/floating_modifier.c
new file mode 100644
index 00000000..9432c9f1
--- /dev/null
+++ b/sway/commands/floating_modifier.c
@@ -0,0 +1,20 @@
1#include "sway/commands.h"
2#include "sway/config.h"
3#include "util.h"
4
5struct cmd_results *cmd_floating_modifier(int argc, char **argv) {
6 struct cmd_results *error = NULL;
7 if ((error = checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1))) {
8 return error;
9 }
10
11 uint32_t mod = get_modifier_mask_by_name(argv[0]);
12 if (!mod) {
13 return cmd_results_new(CMD_INVALID, "floating_modifier",
14 "Invalid modifier");
15 }
16
17 config->floating_mod = mod;
18
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20}