Auto-disable Synaptics touchpad on Linux with USB mouse
10-20-2010 @ 7:24AM EDT
Either way since I use a portable USB mouse 99.9% of the time, I was tempted to just setup the touchpad to always be disabled, but this would fair not to well during those times I didn't have my mouse since it would require me to re-enable it using only the keyboard which can be time consuming. I considered creating a simple script to toggle the touchpad but then I found an even better solution:
Automatically disable the touchpad when a USB mouse is detected!! Yes, I could have stopped here but unfortunately that article is 3 years old and, while still relevant, somethings were different for me and the file needed was missing (except for in PasteBin, but no guarantee that will be there in the future).
So here it is, a quick update to the "Method 1" posted on the site above (tested and confirmed to work like a charm on my HP 2133 with Fedora 13 XFCE).
1) yum install inotify-tools
2) vi /etc/X11/xorg.conf.d/00-system-setup-keyboard.conf and add the following line before "EndSection"
Code:
Option "SHMConfig" "on"
3) Download attached synapticsautooff-1.txt (I downloaded this as my main user to the user's home directory, not root) and rename it (mv synapticsautooff-1.txt synapticsautooff-1.sh).
4) Change the permissions to u+x it (chmod u+x synapticsautooff-1.sh).
THE FOLLOWING IS FOR XFCE ONLY, KDE and GNOME MAY BE DIFFERENT!
5) Add startup program:
XFCE Menu > Preferences > Sessions and Startup > Application Autostart > Add
Code:
Name: SynapticsAutoOff (can be anything you want)
Description: Detect USB mouse and disable touchpad. (can be anything you want)
Command: sh /home/user/synapticsautooff-1.sh &
6) Restart! (Originally it was suggested to restart x but either I was doing it wrong or it wasn't working, YMMV.)
After you log back in, test to confirm the script is working. When the USB mouse is plugged in your touchpad should no longer work, when it's removed it takes about a second for the touchpad to re-enable itself. My only issue is that my HP 2133 has a nice light when the touchpad is disabled but it doesn't utilize this (probably because this is a software disable and not the built-in hardware disable).
Enjoy!
DOWNLOAD: http://jmd.cc/snews/dls/synapticsautooff-1.txt
Comments
This article hasn't been commented yet.



Write a comment
* = required field