Skip to content

Instantly share code, notes, and snippets.

@jorgecasas
Created October 13, 2016 06:32
Show Gist options
  • Save jorgecasas/8aacf0ee56c86918af2bcc9127fdce0d to your computer and use it in GitHub Desktop.
Save jorgecasas/8aacf0ee56c86918af2bcc9127fdce0d to your computer and use it in GitHub Desktop.
Touchpad disable / enable detecting if USB mouse is present
#!/bin/bash
list=`xinput --list | grep -i 'mouse'`
if [ ${#list} -eq 0 ]; then
exec `synclient touchpadoff=0`
notify-send "Touchpad on" "Mouse not present"
else
exec `synclient touchpadoff=1`
notify-send "Touchpad off" "Mouse present"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment