summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 444e6159..f47edd2f 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -171,6 +171,10 @@ static bool cmd_exit(struct sway_config *config, int argc, char **argv) {
171} 171}
172 172
173static bool cmd_floating(struct sway_config *config, int argc, char **argv) { 173static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
174 if (!checkarg(argc, "floating", EXPECTED_EQUAL_TO, 1)) {
175 return false;
176 }
177
174 if (strcasecmp(argv[0], "toggle") == 0) { 178 if (strcasecmp(argv[0], "toggle") == 0) {
175 swayc_t *view = get_focused_container(&root_container); 179 swayc_t *view = get_focused_container(&root_container);
176 // Prevent running floating commands on things like workspaces 180 // Prevent running floating commands on things like workspaces
@@ -241,6 +245,14 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
241 return true; 245 return true;
242} 246}
243 247
248static bool cmd_floating_mod(struct sway_config *config, int argc, char **argv) {
249 if (!checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1)) {
250 return false;
251 }
252 config->floating_mod = xkb_keysym_from_name(argv[0], XKB_KEYSYM_CASE_INSENSITIVE);
253 return true;
254}
255
244static bool cmd_focus(struct sway_config *config, int argc, char **argv) { 256static bool cmd_focus(struct sway_config *config, int argc, char **argv) {
245 if (!checkarg(argc, "focus", EXPECTED_EQUAL_TO, 1)) { 257 if (!checkarg(argc, "focus", EXPECTED_EQUAL_TO, 1)) {
246 return false; 258 return false;
@@ -465,6 +477,7 @@ static struct cmd_handler handlers[] = {
465 { "exec_always", cmd_exec_always }, 477 { "exec_always", cmd_exec_always },
466 { "exit", cmd_exit }, 478 { "exit", cmd_exit },
467 { "floating", cmd_floating }, 479 { "floating", cmd_floating },
480 { "floating_modifier", cmd_floating_mod },
468 { "focus", cmd_focus }, 481 { "focus", cmd_focus },
469 { "focus_follows_mouse", cmd_focus_follows_mouse }, 482 { "focus_follows_mouse", cmd_focus_follows_mouse },
470 { "fullscreen", cmd_fullscreen }, 483 { "fullscreen", cmd_fullscreen },