all repos — dotfiles @ 87fb6579cde259fcc7426ed8b663eb8c0cd4c8af

linux dotfiles

bin/scripts/toggle_touchpad (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
#!/bin/sh

id=$(xinput | grep -i touchpad | grep -o "id=[0-9]*" | grep -o "[0-9]*")
touchpad="$(xinput list-props $id | awk 'NR == 2 {print $4}')"

if [ "$touchpad" -eq 0 ]; then
    xinput --enable $id
else
    xinput --disable $id
fi