T

touchpad-disabler

Scans all the USB devices, if a mouse is found it disables the touchpad, otherwise, it enables it. Useful in conjunction with udev. Licensed under GPLv3.

public
 

To automatically run the program on device plug in or plug out events, add this to udev rules:

ACTION=="add", ATTRS{bInterfaceClass}=="03", ENV{DISPLAY}=":0.0" RUN+="/bin/su - <YOUR USER HERE> -c /usr/local/bin/touchpad_disabler"
ACTION=="remove", ENV{DISPLAY}=":0.0" RUN+="/bin/su - <YOUR USER HERE> -c /usr/local/bin/touchpad_disabler"