Thanks for the guide, my MX510 now works much better with FireFox. I, however, had a problem. I use a laptop so the mouse isn't plugged in all the time and if it isn't, Xorg hangs at startup.
I wrote a little script which verifies if /dev/input/event8 exists and copies a correct xorg.conf in its place. But I didn't know where to put it. So I went to the #ubuntu IRC channel where a helpful fellow suggested using the update-rc.d command. After reading through the man page it was a breeze:
First I needed to move my script into a folder update-rc.d scans when adding a daemon/service. That folder is /etc/init.d.
$ sudo cp logitech-mice.sh /etc/init.d/logitech-mice.sh
$ sudo update-rc.d logitech-mice.sh start 69 S .
Then I actually configured my script to run at the startup (S) runlevel with priority number 69. The number is essential because my X server has the priority number of 70 and I need th script to run before the X server starts.
Here's the script:
Of course if you want the same, you need to change event8 to whichever eventX you configured. I also have 2 backuped xorg.confs:
# logitech-mice.sh Script to set appropriate xorg.conf regarding mouse presence
if [ -e /dev/input/event8 ] && [ -e /etc/X11/xorg.conf-logitech ]
cp /etc/X11/xorg.conf-logitech /etc/X11/xorg.conf
echo " * Logitech MX510 mouse found!"
if [ ! -e /dev/input/event8 ] && [ -e /etc/X11/xorg.conf-backup ]
cp /etc/X11/xorg.conf-backup /etc/X11/xorg.conf
echo " * Logitech MX510 mouse NOT found!"
- xorg.conf-backup which is a backup I made before tweaking it
- xorg.conf-logitech which contains configuration for my Logitech mouse.
Now if only somehow i could run this script whenever the udev rule run as well. I found this file:
I tried adding
$ cat /etc/udev/rules.d/030_sl-modem-daemon.rules
# start/stop the daemon when the USB modem is connected
KERNEL=="slusb[0-9]*", GROUP="dialout", RUN+="/etc/init.d/sl-modem-daemon"
to the udev rule I created for my mouse but it doesn't work.