Skip to content

Instantly share code, notes, and snippets.

@SydLambert
Last active May 17, 2019 20:47
Show Gist options
  • Save SydLambert/a048aa1941af3310c36b43883585edea to your computer and use it in GitHub Desktop.
Save SydLambert/a048aa1941af3310c36b43883585edea to your computer and use it in GitHub Desktop.
Bash script to toggle the trackpad in xinput
#!/usr/bin/env bash
case "$1" in
id)xinput | grep TouchPad | grep --color=never -Po "(?<=id=)\\d+(?=\\t)" ;;
off);&
on)xinput set-prop "$($0 id)" "Device Enabled" "$([ "$1" = 'on' ]&&echo 1||echo 0)";;
*)echo "Usage: $0 {id|off|on}"
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment