On my Lenovo G780, running Mate 16.04, the touchpad is killing me. I have a USB mouse I use instead. At https://askubuntu.com/questions/438179/how-can-i-toggle-the-touchpad-depending-on-whether-a-mouse-is-connected/438220#438220 I found a way to supposedly disable the touchpad if it finds a USB mouse.
#!/usr/bin/env bash ## Get the touchpad id. The -P means perl regular expressions (for \K) ## the -i makes it case insensitive (better portability) and the -o ## means print only the matched portion. The \K discards anything matched ## before it so this command will print the numeric id only. TID=$(xinput list | grep -iPo 'touchpad.*id=\K\d+') ## Run every second while : do ## Disable the touchpad if there is a mouse connected ## and enable it if there is none. xinput list | grep -iq mouse && xinput disable "$TID" || xinput enable "$TID" ## wait one second to avoind spamming your CPU sleep 1 done
“Now, save the script as ~/touchpad.sh, make it executable (chmod +x ~/touchpad.sh) and add it to your GUI session startup programs.”
I accomplished the three steps above, rebooted and the Touchpad is still active. I tried just running the script, but that has no effect either.
I’m now officially lost and need help. Any body have a clue?