My hands are big and unwieldy. My touch pad is hyper sensitive. Together they make a mess of everything I do: the pointer jumps back and forth on the screen like some horny bonobo, and it makes my blood boil.
Easy solution
Turning the touch pad off is easy: synclient TouchPadOff=1.
But having to issue that command all the time is not very elegant, and I’d like the computer to do it by itself. I’m already using an external mouse most of the time, so this is just the matter of turning off the touch pad whenever the mouse is connected. For this we need
- to enable synclient,
- a short udev script to catch plugging and unplugging and
- a short shell script to run synclient
Enabling synclient
synclient is an interface to the Synaptics TouchPad driver. It won’t work until you’ve enabled SHMConfig "on" in the XOrg configuration (usually /etc/X11/xorg.conf). But this is not multi-user safe (from the synclient man page):
WARNING: This is not secure if you are in an untrusted multiuser environment. All local users can change the parameters at any time.
Catch the plug events
On contemporary lunix systems, udev monitors hardware connects and disconnects. This small snippet will run our shell script whenever an external mouse is plugged or unplugged:
KERNEL=="mouse[0-9]*", SUBSYSTEM=="input", RUN="/usr/local/bin/plug_external_mice $devpath"
Add this to your local file /etc/udev/rules.d/10-local.rules (create it if it doesn’t exist).
Manipulate the touch pad
Put this into /usr/local/bin/plug_external_mice and make it executable ( chmod +x /usr/local/bin/plug_external_mice ):
#!/bin/bash
# read http://reactivated.net/writing_udev_rules.html
## uncomment this for debugging:
#echo $ACTION-ing $@ >> /tmp/usb-mice-plug.log
case "$ACTION" in
remove) /usr/bin/synclient TouchpadOff=0 ;;
add) /usr/bin/synclient TouchpadOff=1 ;;
esac
This will turn the touch pad off when you connect the external mouse, and back on when you remove it.
Taking it further
Ideally, there shouldn’t be any need for an external bash script. But, for some reason, these rules won’t work:
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION="add", RUN="/usr/bin/synclient TouchpadOff=1"
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION="remove", RUN="/usr/bin/synclient TouchpadOff=0"
I have no ideas why. If you do, please let me know!
It still doesn't install easily on Windows, which is a bummer.
Get it here: