pub-solar-os/profiles/graphical/xmonad/scripts/touchtoggle
2020-06-09 10:36:38 -06:00

13 lines
399 B
Bash

#!/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