One of the best features of modern gaming mice is the ability to save settings profiles directly on the mouse hardware. This is great when switching computers or booting between multiple installations since the mouse will always feel the same.
Generally the configuration tools for these mice are, unfortunately, Windows only software. And that's where libratbag comes in. libratbag is a library that abstracts away the hardware specifics of each mouse and allows software to interface with the mouse's settings, like DPI or button assignments, without worrying about the hardware specifics of each device.
Piper is a GTK+ application, built on top of libratbag, that provides a nice graphical interface to manage mice settings and profiles. It has pretty much all of the options that you need to setup your mouse properly: DPI settings, profiles, extra button assignments, and yes even LED colour. My Logitech g502 was detected without issue and I was able to configure everything I needed.
For a full list of compatible mice you can check out this Github page
. At the moment it's mostly Logitech and Steelseries mice that are supported. So if you're looking to get a new mouse in the future, I recomment first checking this list if you want the best Linux compatibility.
Installing Piper is also pretty straightforward, just follow their installation guide
. The only issue I had on Kubuntu 18.04 was a missing dependency that was easily solved by a simple 'sudo apt-get install python3-gi-cairo python-gi-cairo'.