Skip to content

Instantly share code, notes, and snippets.

@GeordieP
Created May 27, 2013 04:26
Show Gist options
  • Save GeordieP/5655194 to your computer and use it in GitHub Desktop.
Save GeordieP/5655194 to your computer and use it in GitHub Desktop.
Toggle trackpad on Acer C7 ChromeBook running ChrUbuntu
#!/bin/bash
inputID=$(echo $(xinput --list | grep "cyapa" | cut -d'=' -f2) | cut -d\ -f1)
deviceStatus=$(echo $(xinput list-props $inputID | grep "Enabled" | rev) | cut -d\ -f1)
if [ $deviceStatus == 0 ]; then
echo -e "Trackpad is \e[0;31moff\e[0m, enabling..."
xinput set-prop $inputID "Device Enabled" 1
echo -e "Trackpad \e[0;32menabled.\e[0m"
else
echo -e "Trackpad is \e[0;32mon\e[0m, disabling..."
xinput set-prop $inputID "Device Enabled" 0
echo -e "Trackpad \e[0;31mdisabled.\e[0m"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment