Skip to content

Instantly share code, notes, and snippets.

@a-eid
Created April 6, 2017 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-eid/91a252a7e4ea3d593b870517cda308e3 to your computer and use it in GitHub Desktop.
Save a-eid/91a252a7e4ea3d593b870517cda308e3 to your computer and use it in GitHub Desktop.
command toggle touchpad ubuntu
#!/bin/bash
read TPdevice <<< $( xinput | sed -nre '/TouchPad/s/.*id=([0-9]*).*/\1/p' )
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" )
if [ "$state" -eq '1' ];then
xinput --disable "$TPdevice"
else
xinput --enable "$TPdevice"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment