Boo, Thanks for your help. Works perfectly!
AntiqueXRay, This is what i did to get this to work.
Needed to find out what the computer sees the usb mouse as, so used lsusb from terminal to list connected usb devices:
Code: Select all
:~$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 002: ID 08ca:2010 Aiptek International, Inc. Pocket CAM 3 Mega (webcam)
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 005: ID 03f0:3f11 Hewlett-Packard PSC-1315/PSC-1317
Bus 001 Device 004: ID 0d62:1000 Darfon Electronics Corp.
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
:~$
Unplug mouse try again to confirm that "Darfon" is my mouse.
Then created a text file called touchpadoff.sh
My thinking about the process was:
Pipe the output of "lsusb" into the "grep" command to test for the "Darfon" word. If it is there then "rmmod psmouse" which is what my touchpad appears as.
If it is not there, then test and reactivate the touchpad.
Code: Select all
#!/bin/sh
# Script to look for USB mouse and, if present, disable touchpad
# Can also be run to re-enable touchpad if usb mouse removed
if lsusb | grep "Darfon" ; then
rmmod psmouse
else
modprobe psmouse
fi
For this to work, I made it executable, owned by root (chown) then followed Boo's instructions to get it to run automatically.
Result: One Happy Camper!
Hope that helps....