Skip to content

Instantly share code, notes, and snippets.

@dlozeve
Created January 18, 2019 07:50
Show Gist options
  • Save dlozeve/7ff55147bb6df1964c8cc161b463db2a to your computer and use it in GitHub Desktop.
Save dlozeve/7ff55147bb6df1964c8cc161b463db2a to your computer and use it in GitHub Desktop.
#!/bin/bash
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