some refactor
This commit is contained in:
parent
8e4fd74604
commit
652b984561
1 changed files with 4 additions and 5 deletions
|
@ -5,11 +5,10 @@ DEVNAME='ETPS/2 Elantech Touchpad'
|
||||||
(($#)) || [[ ! -r $STATUSFILE ]]
|
(($#)) || [[ ! -r $STATUSFILE ]]
|
||||||
|
|
||||||
case $? in
|
case $? in
|
||||||
(1|'on') toggle='enable' flag_action=('rm' '-f');;
|
(1|'on') toggle='enable' flag_action=('/usr/bin/rm' '-f');;
|
||||||
(0|'off') toggle='disable' flag_action=('touch');;
|
(0|'off') toggle='disable' flag_action=('/usr/bin/touch');;
|
||||||
(*) exit 1;;
|
(*) exit 1;;
|
||||||
esac
|
esac
|
||||||
notification_msg="Touchpad ${toggle}d"
|
/usr/bin/xinput $toggle $DEVNAME
|
||||||
xinput $toggle $DEVNAME
|
|
||||||
$flag_action[@] $STATUSFILE
|
$flag_action[@] $STATUSFILE
|
||||||
notify-send $notification_msg
|
notify-send "Touchpad ${toggle}d"
|
||||||
|
|
Loading…
Reference in a new issue