Created
February 24, 2022 13:34
-
-
Save MParvin/4cd12798dcdfb96703652bff900b5fd4 to your computer and use it in GitHub Desktop.
Touchpad manager, to enable and disable Laptop touchpad from CLI.
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 -x | |
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