ark/profiles/graphical/xmonad/scripts/touchtoggle

13 lines
399 B
Plaintext
Raw Normal View History

2020-06-09 19:36:38 +03:00
#!/usr/bin/env zsh
touchpad_name=$(libinput list-devices | grep -B 5 "pointer gesture" | awk '/Device/ {for (i=2; i<NF; i++) printf $i " "; print $NF}')
[[ $touchpad_name == "" ]] && exit
touchpad_status=$(xinput list-props "$touchpad_name" | awk '/Device Enabled/ {print $4}')
if [[ $touchpad_status == "0" ]]; then
xinput --enable "$touchpad_name"
else
xinput --disable "$touchpad_name"
fi