Simon Ser 2026-02-12 21:51:54 +01:00 committed by Kenny Levinsen
parent 438010938c
commit fa497964fd
3 changed files with 11 additions and 6 deletions

View file

@ -110,7 +110,7 @@ conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd
conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
conf_data.set10('HAVE_TRAY', have_tray)
foreach sym : ['LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM', 'LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY']
foreach sym : ['LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM', 'LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY', 'LIBINPUT_SWITCH_KEYPAD_SLIDE']
conf_data.set10('HAVE_' + sym, cc.has_header_symbol('libinput.h', sym, dependencies: libinput))
endforeach

View file

@ -543,6 +543,10 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
binding->type = WLR_SWITCH_TYPE_TABLET_MODE;
} else if (strcmp(split->items[0], "lid") == 0) {
binding->type = WLR_SWITCH_TYPE_LID;
#if HAVE_LIBINPUT_SWITCH_KEYPAD_SLIDE
} else if (strcmp(split->items[0], "keypad_slide") == 0) {
binding->type = WLR_SWITCH_TYPE_KEYPAD_SLIDE;
#endif
} else {
free_switch_binding(binding);
return cmd_results_new(CMD_FAILURE,

View file

@ -506,11 +506,12 @@ runtime.
*bindswitch* [--locked] [--no-warn] [--reload] <switch>:<state> <command>
Binds <switch> to execute the sway command _command_ on state changes.
Supported switches are _lid_ (laptop lid) and _tablet_ (tablet mode)
switches. Valid values for _state_ are _on_, _off_ and _toggle_. These
switches are on when the device lid is shut and when tablet mode is active
respectively. _toggle_ is also supported to run a command both when the
switch is toggled on or off.
Supported switches are _lid_ (laptop lid), _tablet_ (tablet mode) and
_keypad_slide_ (whether the device keypad is exposed or not) switches. Valid
values for _state_ are _on_, _off_ and _toggle_. These switches are on when
the device lid is shut, when tablet mode is active and when the keypad is
exposed respectively. _toggle_ is also supported to run a command both when
the switch is toggled on or off.
Unless the flag _--locked_ is set, the command will not be run when a
screen locking program is active. If there is a matching binding with