I was looking for a supported "Linux" mouse that offers a comfortable and robust design and which has customizable features for an good price. There are lots of mice on the market, that fits these points under windows. But I'm using Ubuntu together with Steam and the market for Ubuntu/Linux supported Hardware is not as great. After a little literature research I've found the G500s from Logitech. The reviews online magazine PCMag concluded:
"For a mouse that only differs from its predecessor in terms of sensor accuracy, the Logitech G500s is a surprisingly good mouse. While I didn't particularly care for the paint job—it looks like it's trying way too hard to convince me that it's cool—it's hard to argue with the actual performance. The Logitech G500s is a solid, accurate and straightforward gaming mouse. For the G500 fan that needs an upgrade, it's a no-brainer. For everyone else, while the Editors' Choice Corsair Vengeance M65 still leads with a slightly better design, the Logitech G500s is still worth a look."
and TomsGuide verticted:
"The Logitech G500s is nearly perfect. This gaming mouse embraces smart design choices at every avenue, and provides an experience that is neither minimalist nor ornate, but balanced in every sense. The G500s may not be the ideal mouse for every consumer and every genre, but it's pretty close. Unless you're a high-level massively multiplayer online gamer and need a plethora of thumb buttons, you'd be wise to consider the G500s in your search for a gaming mouse."
Therefore, I considered the G500s in my search. The most advantage is, that this gaming mouse has 10 programmable buttons, that can be configured under Linux. You can find an overview about the Logitech G500 buttons that can be used under linux in the following table:
You can find more information about this mouse on the Logitech Homepage.
Identify Hardware
In my case, all buttons are detected under Kernel 4.8. You can check your Kernel version with:
- uname -a
Linux thomas 4.8.0-26-generic #28-Ubuntu SMP Tue Oct 18 14:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Furthermore, have a look if your G500s is identified correctly:
- dmesg | grep G500s
[ 2.560081] usb 4-4: Product: G500s Laser Gaming Mouse
[ 2.575358] input: Logitech G500s Laser Gaming Mouse as /devices/pci0000:00/0000:00:04.0/usb4/4-4/4-4:1.0/input/input5
[ 2.575479] hid-generic 0003:046D:C24E.0002: input,hidraw1: USB HID v1.11 Mouse [Logitech G500s Laser Gaming Mouse] on usb-0000:00:04.0-4/input0
[ 2.591182] input: Logitech G500s Laser Gaming Mouse as /devices/pci0000:00/0000:00:04.0/usb4/4-4/4-4:1.1/input/input6
[ 2.591306] hid-generic 0003:046D:C24E.0003: input,hiddev0,hidraw2: USB HID v1.11 Keyboard [Logitech G500s Laser Gaming Mouse] on usb-0000:00:04.0-4/input1
- lsusb | grep Logitech
Bus 010 Device 003: ID 046d:c24e Logitech, Inc. G500s Laser Gaming Mouse
Power Control
With the latest Kernel 4.4 RC4, I have a problem of mouse disconnects while steam gaming. You can prevent this by using Udev rules to automate power management of the G500s. You need to create a udev rule and insert the following code:
- sudo nano /etc/udev/rules.d/99-logitech-mouse.rules
- ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c24e", ATTR{product}=="G500s Laser Gaming Mouse", TEST=="power/control", ATTR{power/control}="on"
Restart your PC and Udev is using this rule.
Installation and configuration of XBindKeys
XBindKeys allows you to launch shell commands with your keyboard or your mouse in Unity or Gnome. You have to install it in Ubuntu with
- sudo apt-get install xbindkeys xautomation
and to edit or create ~/.xbindkeysrc with gedit ~/.xbindkeysrc
in order to insert the xbindkey's button-to-key config:
- # Paste with the middle key
- "xte 'keydown Control_L' 'key V' 'keyup Control_L'"
- b:2
- # Scroll Left = "previous Tab" in Browser
- "xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
- b:6
- # Scroll right = "next Tab" in Browser
- "xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
- b:7
- # Sound Lower
- "xte 'key XF86AudioLowerVolume'"
- b:8
- # Sound Louder
- "xte 'key XF86AudioRaiseVolume'"
- b:9
- #Present Windows
- "xte 'key Super_L'"
- b:10
After this you can test the binded keys with
- xbindkeys -f ~/.xbindkeysrc
in your shell.
Start XBindKey on Ubuntu startup
You can use gnome-session-properties to start XBindKeys on computer startup. A good description to create a startup application you can find in the Ubuntu Wiki under AddingProgramToSessionStartup.
The settings looks like this:
- Name: XBindKeys
- Command: /usr/bin/xbindkeys_autostart
- Description: Starts XBindKeys. Config can be set in ~/.xbindkeysrc
Control the dpi rate under Ubuntu for Logitech G500
Vladyslav Shtabovenko created a small app for tweaking the Logitech G500 gaming mouse under Linux. This software allows you to configure the hardware settings of the G500 gaming mouse, e.g. dots per inch (dpi) resolution, USB report rate or angle snapping. Normally you can only do this by using Windows with the Logitech SetPoint Software. This tool will flash your lovely settings directly into the G500's internal profile. The dpi rate relates directly to the mouse reading, along with the movement on screen. In other words, if you use a 1024x786 screen resolution, and you having a 1000DPI mouse, it would 'technicly' take 1 inch to move from one side to the other.
At first you need to download the software from GitHub.
- mkdir /tmp/g500 && cd /tmp/g500
- git clone https://github.com/vsht/g500-control.git
Now, you are able to install this tool very easily:
- cd g500-control
- make
- sudo make install
After the successful installation, g500-control is available with /usr/sbin/g500-control
.
Examples for g500-control
DPI 400, 800 and 2000
This example corresponds to G500's factory settings with 500 USB report rate, angle snapping disabled and 3 dpi resolutions (400, 800 and 2000). The dpi buttons are used to switch between the 3 dpi values.
- sudo g500_control /dev/usb/hiddev0 --urr_default --as_default --dpi_default
DPI 1600 for both axes
In this example only one dpi resolution (1600 dpi for both axes) is set. The DPI buttons can be mapped to anything you want via xbindkeys or similar tools.
- sudo g500_control /dev/usb/hiddev0 --urr_default --as_default --dpi_1 1600 1600
DPI 1600 for both axes and with higher USB report rate
This examples looks like the same as above, but now we increase USB report rate from 500 to 1000 and enable angle snapping.
- sudo g500_control /dev/usb/hiddev0 --1000 --as_on --dpi_1 1600 1600
Different dpi resolutions for each axis
In this example we increase USB report rate from 500 to 1000 and enable angle snapping. Furthermore, we also use different dpi resolutions for each axis. For the x axis it's 3200 and for the y axis it's 4000.
- sudo g500_control /dev/usb/hiddev0 --1000 --as_on --dpi_1 3200 4000
G500s dpi profiles
Now we can change to an more interesting example. We set 3 different dpi resolutions: 800, 1600 and 5700 (equal for both axes). The dpi buttons (+/-) are used to switch between these. Moreover, we explicitly set USB repeat rate to 500 and disable angle snapping.
- sudo g500_control /dev/usb/hiddev0 --500 --as_off --dpi_3 800 800 1600 1600 5700 5700 dpi_btn_up
Change switch buttons
This example is the same as same as G500s dpi profile but here we use (<-/->) as dpi buttons.
- sudo g500_control /dev/usb/hiddev0 --500 --as_off --dpi_3 800 800 1600 1600 5700 5700 dpi_btn_side
5 different dpi's
In this example, we set 5 different dpi resolutions: 800, 1600, 3200, 4800 and 5700 (equal for both axes). The dpi buttons (+/-) are used to switch between these. Moreover, we explicitly set USB repeat rate to 333 and enable angle snapping.
- sudo g500_control /dev/usb/hiddev0 --333 --as_on --dpi_5 800 800 1600 1600 3200 3200 4800 4800 5700 5700 dpi_btn_up
... and other switches
In this example, we set 5 different dpi resolutions: 800, 1600, 3200, 4800 and 5700 (equal for both axes). The dpi buttons (+/-) are used to switch between these.
- sudo g500_control /dev/usb/hiddev0 --333 --as_on --dpi_5 800 800 1600 1600 3200 3200 4800 4800 5700 5700 dpi_btn_up
... ,other switches and a second resolution
This example is similar to the above, but the second resolution has now different values for the axes: 1600 dpi for the x axis and 1000 dpi for the y axis
- sudo g500_control /dev/usb/hiddev0 --333 --as_on --dpi_5 800 800 1600 1000 3200 3200 4800 4800 5700 5700 dpi_btn_up