aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-08-18 01:07:12 -0700
committertaiyu <taiyu.len@gmail.com>2015-08-18 01:07:12 -0700
commit4606fb1ee3102dcaeab005d64eeead5842a5cd3e (patch)
treebca27e2363a8c6e4a51dc8f19d48ca95c699a987 /sway/commands.c
parentf0fe4a346d46b2033d8ceff9b06b558d82f51f6d (diff)
parente541ba3d876de8ce2812482fc6bfa13b236c6a58 (diff)
merged Luminarys resizing code
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 134593c7..548cb8ed 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) {
}
static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
+ if (!checkarg(argc, "floating", EXPECTED_EQUAL_TO, 1)) {
+ return false;
+ }
+
if (strcasecmp(argv[0], "toggle") == 0) {
swayc_t *view = get_focused_container(&root_container);
// Prevent running floating commands on things like workspaces
@@ -242,6 +246,14 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
return true;
}
+static bool cmd_floating_mod(struct sway_config *config, int argc, char **argv) {
+ if (!checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1)) {
+ return false;
+ }
+ config->floating_mod = xkb_keysym_from_name(argv[0], XKB_KEYSYM_CASE_INSENSITIVE);
+ return true;
+}
+
static bool cmd_focus(struct sway_config *config, int argc, char **argv) {
if (!checkarg(argc, "focus", EXPECTED_EQUAL_TO, 1)) {
return false;
@@ -466,6 +478,7 @@ static struct cmd_handler handlers[] = {
{ "exec_always", cmd_exec_always },
{ "exit", cmd_exit },
{ "floating", cmd_floating },
+ { "floating_modifier", cmd_floating_mod },
{ "focus", cmd_focus },
{ "focus_follows_mouse", cmd_focus_follows_mouse },
{ "fullscreen", cmd_fullscreen },