Created
August 7, 2020 10:29
-
-
Save MParvin/f5ac1dd3736fa3a56a79309aa9e3b015 to your computer and use it in GitHub Desktop.
Easy disable and enable touch pad from Bash
This file contains hidden or 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 | |
showUsage() { | |
echo -e "Usage is /scripts/tochpad.sh [OPTIONS]\n\t-e To enable touch pad\n\t-d For Disable touch pad\n\t-h for this Help" | |
} | |
if [ "$#" -eq 0 ] | |
then | |
showUsage | |
exit 1 | |
fi | |
while getopts "de" OPTION; do | |
case $OPTION in | |
e) | |
echo "Enabling Touch Pad" | |
xinput set-prop `xinput list | grep -i touchpad | cut -d'=' -f2 | awk '{print $1}'` 'Device Enabled' 1 | |
;; | |
d) | |
echo "Disabling Touch Pad" | |
xinput set-prop `xinput list | grep -i touchpad | cut -d'=' -f2 | awk '{print $1}'` 'Device Enabled' 0 | |
;; | |
*) | |
showUsage | |
exit 1 | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment