aboutsummaryrefslogtreecommitdiffstats
path: root/sway/sway.5.scd
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/sway.5.scd
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/sway.5.scd')
-rw-r--r--sway/sway.5.scd28
1 files changed, 25 insertions, 3 deletions
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index 989717cb..18fc28a3 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -341,6 +341,28 @@ runtime.
341 *bindcode* [--whole-window] [--border] [--exclude-titlebar] [--release] [--locked] [--input-device=<device>] [--no-warn] <code> <command> 341 *bindcode* [--whole-window] [--border] [--exclude-titlebar] [--release] [--locked] [--input-device=<device>] [--no-warn] <code> <command>
342 is also available for binding with key/button codes instead of key/button names. 342 is also available for binding with key/button codes instead of key/button names.
343 343
344*bindswitch* [--locked] [--no-warn] <switch>:<state> <command>
345 Binds <switch> to execute the sway command _command_ on state changes.
346 Supported switches are _lid_ (laptop lid) and _tablet_ (tablet mode)
347 switches. Valid values for _state_ are _on_, _off_ and _toggle. These
348 switches are on when the device lid is shut and when tablet mode is active
349 respectively. _toggle_ is also supported to run a command both when the
350 switch is toggled on or off.
351
352 Unless the flag _--locked_ is set, the command will not be run
353 when a screen locking program is active. By default, if you
354 overwrite a binding, swaynag will give you a warning. To silence this, use
355 the _--no-warn_ flag.
356
357 Example:
358```
359 # Show the virtual keyboard when tablet mode is entered.
360 bindswitch tablet:on busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
361
362 # Log a message when the laptop lid is opened or closed.
363 bindswitch lid:toggle exec echo "Lid moved"
364```
365
344*client.<class>* <border> <background> <text> <indicator> <child_border> 366*client.<class>* <border> <background> <text> <indicator> <child_border>
345 Configures the color of window borders and title bars. All 5 colors are 367 Configures the color of window borders and title bars. All 5 colors are
346 required, with the exception of *client.background*, which requires exactly 368 required, with the exception of *client.background*, which requires exactly
@@ -551,9 +573,9 @@ The default colors are:
551 Switches to the specified mode. The default mode _default_. 573 Switches to the specified mode. The default mode _default_.
552 574
553*mode* [--pango_markup] <mode> <mode-subcommands...> 575*mode* [--pango_markup] <mode> <mode-subcommands...>
554 The only two valid _mode-subcommands..._ are *bindsym* and *bindcode*. 576 The only valid _mode-subcommands..._ are *bindsym*, *bindcode* and
555 If _--pango_markup_ is given, then _mode_ will be interpreted as pango 577 *bindswitch*. If _--pango_markup_ is given, then _mode_ will be interpreted
556 markup. 578 as pango markup.
557 579
558*mouse_warping* output|container|none 580*mouse_warping* output|container|none
559 If _output_ is specified, the mouse will be moved to new outputs as you 581 If _output_ is specified, the mouse will be moved to new outputs as you