diff options
author | Ryan Walklin <ryan@testtoast.com> | 2019-03-20 14:47:29 +1100 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2019-03-19 23:58:47 -0400 |
commit | bdb402404cd6d54242b0b1dc2360cfc5679e52f2 (patch) | |
tree | 5a355e025c24b3de0bc69db4b8cc9d002bbd1167 /sway/commands/mode.c | |
parent | Clean up focus follows mouse logic (diff) | |
download | sway-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/mode.c')
-rw-r--r-- | sway/commands/mode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/commands/mode.c b/sway/commands/mode.c index d424eb1c..3e0ee80c 100644 --- a/sway/commands/mode.c +++ b/sway/commands/mode.c | |||
@@ -12,6 +12,7 @@ | |||
12 | // Must be in order for the bsearch | 12 | // Must be in order for the bsearch |
13 | static struct cmd_handler mode_handlers[] = { | 13 | static struct cmd_handler mode_handlers[] = { |
14 | { "bindcode", cmd_bindcode }, | 14 | { "bindcode", cmd_bindcode }, |
15 | { "bindswitch", cmd_bindswitch }, | ||
15 | { "bindsym", cmd_bindsym } | 16 | { "bindsym", cmd_bindsym } |
16 | }; | 17 | }; |
17 | 18 | ||
@@ -54,6 +55,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) { | |||
54 | mode->keysym_bindings = create_list(); | 55 | mode->keysym_bindings = create_list(); |
55 | mode->keycode_bindings = create_list(); | 56 | mode->keycode_bindings = create_list(); |
56 | mode->mouse_bindings = create_list(); | 57 | mode->mouse_bindings = create_list(); |
58 | mode->switch_bindings = create_list(); | ||
57 | mode->pango = pango; | 59 | mode->pango = pango; |
58 | list_add(config->modes, mode); | 60 | list_add(config->modes, mode); |
59 | } | 61 | } |