Disabling your trackpad when a mouse is connected

Typing on my laptop often has the side effect of touching the trackpad and sending the cursor wildly off and insterting text elsewhere. This is highly irritating when programming. Thankfully there is a simple one line fixfor GNU/Linux systems using udev. Simply add

ACTION=="add", SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/<your username>/.Xauthority", ENV{ID_CLASS}="mouse", ENV{REMOVE_CMD}="/usr/bin/synclient TouchpadOff=0", RUN+="/usr/bin/synclient TouchpadOff=1"



unplug and replug your mouse and you should be good to go.


Date Tags code / udev