Blog

Tweet

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”

Posted in Linux | Tagged | 5 Comments
Tweet

2 mice are not better than 1

Since I have gotten my new laptop I have quickly become annoyed that when I plug in my external USB wireless mouse my synaptics touchpad is still active. The touchpad is fine when I am not using an external mouse, but I can’t stand tapping it while I am typing. So yesterday while making some jokes towards Cody Somerville and Martin Meredith on writing a program to fix it, they said a quick script could take care of it in the mean time. So what I did is wrote an elaborate, super hacker, elite bash script that starts with X. So you want to see it? Well, I can show you that and not have to kill you afterwards! Here it is:

mousecount=`grep mouse /proc/bus/input/devices |grep Handler |wc -l`
if [ "$mousecount" -eq "1" ]
then
synclient TouchpadOff=0
else
if [ "$mousecount" -gt "1" ]
then
synclient TouchpadOff=1
fi
fi

What this does is executes the grep command and assigns the output to $mousecount. The first “if” statement tests to see if only 1 mouse is active, in my case it would be the touchpad and no external mouse, so it will insure it doesn’t get deactivated. If that doesn’t test out, the next “if” statement will see if it is equal to 2, meaning I have more than 1 mouse attached, the 2nd being the external USB wireless mouse. If it sees 2 mice, then it will execute the “synclient TouchpadOff=1″ command disabling the synaptics touchpad.

Pretty easy I think. Now if someone can come up with an even better way of doing this, please keep me informed. My little script is rather hackish, but it does what I want it to. I would love to see an application do this automatically when I plug or unplug my external mouse. Any takers :)

Posted in Linux | Tagged | 16 Comments
Tweet

Firefox Search Plugins

I created 4 simple search plugins for Firefox for anyone who is interested.

  • wikiubuntutext.src - This searches text at https://wiki.ubuntu.com
  • wikiubuntutitle.src - This searches titles at https://wiki.ubuntu.com
  • ubuntuhelptext.src - This searches text at https://help.ubuntu.com/community
  • ubuntuhelptitle.src - This searches titles at https://help.ubuntu.com/community

Download the archived file to a directory and then extract it. After extraction, copy the files to /usr/share/firefox/searchplugins and enjoy!

Posted in Application | Tagged | 2 Comments
  • Subscribe to nixternal.com

     Subscribe in a reader

    Or, subscribe via email:
    Enter your email address:

  • Archives

semidetached
semidetached
semidetached
semidetached