Created
July 23, 2017 01:53
-
-
Save shawn111/65ee978a0401efcdca8e8c5922c23bdb to your computer and use it in GitHub Desktop.
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 | |
declare -i ID | |
ID=`xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'` | |
declare -i STATE | |
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'` | |
if [ $STATE -eq 1 ] | |
then | |
xinput disable $ID | |
echo "Touchpad disabled." | |
else | |
xinput enable $ID | |
echo "Touchpad enabled." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment