Blog Post

1 mouse, 2 mouse, IT WORKS!

Thanks to muzzol for the solution to the plug/unplug detection of an external USB mouse and disabling/enabling the Synaptics Touchpad. And now the answer you have all be waiting for!

Add the following line to your /etc/udev/rules.d/85-hal.rules file:

KERNEL==”mouse*”, RUN+=”/usr/bin/udevmice.sh”

Once you have added that, the next step would be to create the /usr/bin/udevmice.sh file. Here is what is in that file:

#!/bin/bash
#DATE=`date`
#FLOG=”/tmp/udev_test.log”
#echo “$DATE – [$*] – [$ACTION]” >> “$FLOG”
case $ACTION in
add)
#echo “DEBUG: conectat” >> “$FLOG”
synclient TouchpadOff=1
;;
remove)
#echo “DEBUG: desconectat” >> “$FLOG”
synclient TouchpadOff=0
;;
esac

Uncomment (remove the #) from the lines in the code if you want the script to log to /tmp/udev_test.log every time you plug/unplug your mouse. DO NOT remove the # from the #!/bin/bash line. And that concludes this tutorial. Thanks again to muzzol who left a comment in my previous post.

UPDATE: I forgot to mention that you need to make one small edit to your /etc/X11/xorg.conf file in order for the synclient command to work. Under InputDevice section, look for the Identifier for “Synaptics Touchpad”. This is where you want to add the following extra option:

Option “SHMConfig” “on”

This entry was posted in Linux and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • Archives


semidetached
semidetached
semidetached
semidetached
%d bloggers like this: