Skip to content

Instantly share code, notes, and snippets.

@terrynguyen255
Created October 16, 2019 03:53
Show Gist options
  • Save terrynguyen255/48536c9d6c0c3aaf524f48980b40997c to your computer and use it in GitHub Desktop.
Save terrynguyen255/48536c9d6c0c3aaf524f48980b40997c to your computer and use it in GitHub Desktop.
# Works best on my laptop DELL XPS 9570 - Ubuntu 18.04
#!/bin/bash
touchpad_id=$(xinput list | sed -nre '/Touchpad/s/.*id=([0-9]*).*/\1/p')
state=$( xinput list-props "$touchpad_id" | grep "Device Enabled" | grep -o "[01]$" )
if [ "$state" -eq '1' ];then
xinput --disable "$touchpad_id" && notify-send -i emblem-nowrite "Touchpad" "Disabled"
else
xinput --enable "$touchpad_id" && notify-send -i input-touchpad "Touchpad" "Enabled"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment