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