vscripts/touchpad-toggle
2019-03-12 14:31:30 +03:00

14 lines
408 B
Bash
Executable file

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