I actually had to mess around with mouse for a while, because for some reason Piper doesn’t work with my wireless Logitech mouse.
The first thing that I did was using a combination of
xdotools (was it
xautomation now? I forgot), and
xev. xev allows you to read keyboard and mouse events, so it’s what I used to find what’s the name for the buttons I need to put in the xbindkeys .xbindkeysrc file, which can use keyboard/mouse events to trigger xdotool with any commands (for me, I use it to change scroll wheel left/right for switching tabs with Ctrl + Prior / Next (PageUp / PageDown)). So you just put in xbindkeys as an autostart program, and it’ll work.
The problem was that I eventually tried out Fedora, and xorg tools naturally don’t work with Wayland. There is ydotool and libinput via mouse-mapper but I found something better.
key-mapper is what I use these days. It has nice GUI, that can automatically detect key presses, and has some macro functionalities. While it doesn’t allow save-to-memory, it does have an auto-load function in GUI so it’ll always load the daemon on start-up.
The only issue is that it doesn’t have rotating profile switch (unless you rudimentary it with macro, alternate config files, and the key-mapper load profile which is too much hassle for me), RGB is naturally not within its scope, and no auto-profile based on window/application title (but basic support for requirement of it seems to be in the pipeline).
For that last one, apparently only autokey has it but that one is outright “let’s reprogram our mouse with actual bash and python scripts,” and is x11 only I think.
There are others, I found here: Key Remapping in Linux — 2021 Edition | by Duane Johnson | Nov, 2021 | Medium
Mouse acceleration profile probably has other utilities you need to use for it. I haven’t looked into it yet, though if you want to change from adaptive and flat acceleration as well as set mouse speed, KDE has it built-in on their System Settings. I haven’t needed to change anything yet, so I don’t know much about it, sorry. It is on the pipeline for key-mapper in the future though.
While I’m at it, there is Solaar for Logitech devices. I don’t know much beyond that it could pair and un-pair devices with the universal receiver. And for Razer I think there is OpenRazer? Never tried it, don’t own any Razer stuff.