Disable Touchpad with external Mouse
Since udev is standard on most distributions it is pretty easy to interact with the events generated. We want to disable the touchpad completly when an external mouse is plugged in (and of course enable it, when it is unplugged)
Just two simple lines in
/etc/udev/rules.d/01-touchpad.rules
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=1" ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"
Remember: You need
Option "SHMConfig" "on"
in the touchpad-device section of your /etc/X11/xorg.conf
for every „on-the-fly“ change to your touchpad.