dotfiles/sway/toggle_touchpad
Midgard 7725111195
[sway] Improve toggle_touchpad
To take into account disabled_on_external_mouse
2022-09-07 22:40:43 +02:00

15 lines
308 B
Bash
Executable file

#!/bin/sh
current_state() {
swaymsg -t get_inputs | jq -r 'map(select(.type == "touchpad")) | .[0].libinput.send_events'
}
set_state() {
swaymsg "input type:touchpad events $@"
}
if [ "$(current_state)" == disabled_on_external_mouse ]; then
set_state disabled
else
set_state toggle enabled disabled
fi