aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
authorLibravatar Ryan Walklin <ryan@testtoast.com>2019-03-20 14:47:29 +1100
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-19 23:58:47 -0400
commitbdb402404cd6d54242b0b1dc2360cfc5679e52f2 (patch)
tree5a355e025c24b3de0bc69db4b8cc9d002bbd1167 /sway/commands.c
parentClean up focus follows mouse logic (diff)
downloadsway-bdb402404cd6d54242b0b1dc2360cfc5679e52f2.tar.gz
sway-bdb402404cd6d54242b0b1dc2360cfc5679e52f2.tar.zst
sway-bdb402404cd6d54242b0b1dc2360cfc5679e52f2.zip
Support WLR_INPUT_DEVICE_SWITCH in sway
This commit adds support for laptop lid and tablet mode switches as provided by evdev/libinput and handled by wlroots. Adds a new bindswitch command with syntax: bindswitch <switch>:<state> <command> Where <switch> is one of: tablet for WLR_SWITCH_TYPE_TABLET_MODE lid for WLR_SWITCH_TYPE_LID <state> is one of: on for WLR_SWITCH_STATE_ON off for WLR_SWITCH_STATE_OFF toggle for WLR_SWITCH_STATE_TOGGLE (Note that WLR_SWITCH_STATE_TOGGLE doesn't map to libinput and will trigger at both on and off events)
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index cb32169f..18b95c73 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -47,6 +47,7 @@ static struct cmd_handler handlers[] = {
47 { "assign", cmd_assign }, 47 { "assign", cmd_assign },
48 { "bar", cmd_bar }, 48 { "bar", cmd_bar },
49 { "bindcode", cmd_bindcode }, 49 { "bindcode", cmd_bindcode },
50 { "bindswitch", cmd_bindswitch },
50 { "bindsym", cmd_bindsym }, 51 { "bindsym", cmd_bindsym },
51 { "client.background", cmd_client_noop }, 52 { "client.background", cmd_client_noop },
52 { "client.focused", cmd_client_focused }, 53 { "client.focused", cmd_client_focused },
@@ -386,6 +387,7 @@ struct cmd_results *config_command(char *exec, char **new_block) {
386 && handler->handle != cmd_mode 387 && handler->handle != cmd_mode
387 && handler->handle != cmd_bindsym 388 && handler->handle != cmd_bindsym
388 && handler->handle != cmd_bindcode 389 && handler->handle != cmd_bindcode
390 && handler->handle != cmd_bindswitch
389 && handler->handle != cmd_set 391 && handler->handle != cmd_set
390 && handler->handle != cmd_for_window 392 && handler->handle != cmd_for_window
391 && (*argv[i] == '\"' || *argv[i] == '\'')) { 393 && (*argv[i] == '\"' || *argv[i] == '\'')) {