Advertisement
Guest User

toggle_mousepad.sh

a guest
May 31st, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.44 KB | None | 0 0
  1. #!/bin/sh
  2. TOUCHPAD_ID=`xinput | grep 'Synaptics TouchPad' | cut -f 2 | cut -f 2 -d =`
  3. TOUCHPAD_STATUS=`xinput --list-props 11 | grep 'Device Enabled' | cut -f 3`
  4. TOUCHPAD_REGISTER=`xinput --list-props 11 | grep 'Device Enabled' | cut -f 2 | cut -f 2 -d '(' | cut -f 1 -d ')'`
  5. if [ $TOUCHPAD_STATUS -eq 1 ] ; then
  6.     TOUCHPAD_STATUS=0
  7. else
  8.     TOUCHPAD_STATUS=1
  9. fi
  10. xinput --set-prop $TOUCHPAD_ID $TOUCHPAD_REGISTER $TOUCHPAD_STATUS
  11. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement