dot-files/scripts/toggle-touchpad

14 lines
347 B
Plaintext
Raw Normal View History

#! /bin/sh
# Device id according to xinput list
device=11
state=$(xinput list-props "$device" | grep "Device Enabled" | grep -o "[01]$")
if [ "$state" == "1" ];then
xinput --disable "$device"
notify-send -t 500 -u low "Toggled touchpad (disabled)"
else
xinput --enable "$device"
notify-send -t 500 -u low "Toggled touchpad (enabled)"
fi