Skip to content

Instantly share code, notes, and snippets.

@MParvin
Created August 7, 2020 10:29
Show Gist options
  • Save MParvin/f5ac1dd3736fa3a56a79309aa9e3b015 to your computer and use it in GitHub Desktop.
Save MParvin/f5ac1dd3736fa3a56a79309aa9e3b015 to your computer and use it in GitHub Desktop.
Easy disable and enable touch pad from Bash
#!/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