random script dump
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

touchpad-toggle 408B

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