Created
June 22, 2015 21:46
-
-
Save armando-basile/a1e5f958f92eb358123e to your computer and use it in GitHub Desktop.
ASUS Touchpad disable/enable script (require xinput and gxmessage)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CMD="gxmessage -borderless -ontop -title Information -center -timeout 3 " | |
IS_TOUCHPAD=`xinput list-props "FocalTechPS/2 FocalTech FocalTech Touchpad" | grep "Device Enabled (145): 1"` | |
# detect if is superuser | |
if [[ $EUID -ne 0 ]] | |
then | |
echo -e "This script must be run as rootn" | |
exit 1 | |
fi | |
if [ "$IS_TOUCHPAD" == "" ] | |
then | |
# enable touchpad | |
xinput enable "FocalTechPS/2 FocalTech FocalTech Touchpad" | |
$CMD -fn "sans 30" Touchpad ENABLED | |
else | |
# disable touchpad | |
xinput disable "FocalTechPS/2 FocalTech FocalTech Touchpad" | |
$CMD -fn "sans 30" Touchpad DISABLED | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment