Once a while™ I like to play strategy or MMO games on PC.
Back in 2006 I bought the fantastic Logitech MX518 gaming mouse and have been using it ever since.
(Image source: Amazon)
As you can see in the picture the mouse sports extra buttons that are handy when assigned properly in games.
This works just fine under Windows with the tools Logitech provides.
Before Ubuntu switched to
systemd there was a tool named
btnx that enabled me to assign keyboard keys to mouse buttons.
It just worked!
With the adaption of
systemd in Ubuntu (16.04 was my first version with systemd, since I only use LTS versions),
btnx stopped working since it relied on
So here is how I got it to work with
sudo apt install lomoco
Configure lomoco and set the mouse resolution to 1200, otherwise the button reassignment is not possible:
sudo vim /etc/default/lomoco
The resulting file should look like this:
# Configuration file for lomoco # see `man lomoco` for details # Define which resolution should be used # Values: 800,400,1200,1600 LOGITECH_MOUSE_RESOLUTION=1200 # Whether to disable SmartScroll/Cruise Control. Defaults to yes if not set. # Values: yes,no LOGITECH_MOUSE_DISABLE_CC=
Install the outdated packages btnx-config and btnx (in this order).
Create the btnx.service for systemd (I still think one of those files is redundant, I did not dive that deep into systemd yet):
Content of the btnx.service file:
[Unit] Description=Btnx Documentation=https://ooz.github.io After=graphical.target [Service] Type=simple ExecStart=/usr/sbin/btnx PIDFile=/var/run/btnx.pid Restart=on-abort
Place it at the following locations:
sudo cp btnx.service /etc/systemd/system/ sudo cp btnx.service /etc/systemd/system/graphical.target.wants/
Start the btnx.service:
sudo systemctl start btnx.service
You can verify whether the service has launched with the following command:
systemctl status btnx.service
Launch btnx-config and configure your mouse!
Restart Ubuntu and you are done!