vscripts/touchpad-toggle

15 lines
402 B
Text
Raw Normal View History

2019-03-12 14:17:26 +03:00
#!/usr/bin/env zsh
STATUSFILE="/run/user/${UID}/touchpad_disabled"
DEVNAME='ETPS/2 Elantech Touchpad'
(($#)) || [[ ! -r $STATUSFILE ]]
case $? in
2019-03-12 14:22:23 +03:00
(1|'on') toggle='enable' flag_action=('/usr/bin/rm' '-f');;
(0|'off') toggle='disable' flag_action=('/usr/bin/touch');;
2019-03-12 14:20:33 +03:00
(*) exit 1;;
2019-03-12 14:17:26 +03:00
esac
2019-03-12 14:22:23 +03:00
/usr/bin/xinput $toggle $DEVNAME
2019-03-12 14:17:26 +03:00
$flag_action[@] $STATUSFILE
2019-03-12 14:23:07 +03:00
/usr/bin/notify-send "Touchpad ${toggle}d"