How to Set Up Logitech M510 USB Mouse on Ubuntu 12.04

Logitech has a great selection of USB mice for all operating systems and they often work without installing any software. Sometimes to get the most out of it however, you can configure your xorg.conf file on Ubuntu 12.04 and some previous Ubuntus.

2017 Update: If you use Ubuntu 14.04 or 16.04 or higher, you no longer need to custom configure this mouse, it works perfectly out of the box!

After plugging in the Logitech M510 USB wireless laser mouse, make sure the batteries are in and it is turned on. Then put this code into your /etc/X11/xorg.conf file:

Section "InputDevice"
Identifier "Logitech Mouse"
Driver "evdev"
Option "Protocol" "evdev"
Option "Name" "Logitech USB Optical Mouse"
Option "Phys" "usb-*/input0"
Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-mouse"
Option "Buttons" "8"
Option "ZAxisMapping" "4 5"
Option "Resolution" "1200"
Option "CorePointer"

Note: If your xorg.conf file already has a section labeled “InputDevice”, replace it with this one.

It is recommended that you copy your current xorg.conf file to another one using the “cp” command before using this code. After it is done, restart your computer (logout/login might also work).