2022-08-29 23:22:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-09-07 22:40:37 +02:00
|
|
|
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
|