Skip to content

Instantly share code, notes, and snippets.

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