[sway] Improve toggle_touchpad
To take into account disabled_on_external_mouse
This commit is contained in:
parent
3ddd8ecbb3
commit
7725111195
1 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
swaymsg 'input type:touchpad events toggle enabled disabled'
|
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
|
||||||
|
|
Loading…
Reference in a new issue