Linux · System Tools
libratbag
libratbag is a Linux library and CLI tool that manages gaming mice profiles, replacing Logitech G Hub.
- License
- GPL-3.0
- Latest version
- 0.18
What is libratbag?
libratbag lets you configure DPI, polling rate, button mapping, and macros for a wide range of gaming mice. It started as a community project in 2015 and has grown to support over 200 devices, with regular updates from the open‑source community.
The tool is aimed at gamers and power users who want fine‑grained control without a proprietary client. It runs in the background, reading device events and applying settings from simple configuration files.
Compared with Windows‑only G Hub, libratbag feels lightweight and scriptable. There is no graphical wizard, but you can edit plain text files or use the companion GUI, ratbagctl-gui, for a more familiar interface.
Best for: Gamers who need custom mouse settings on Linux without relying on vendor software.
Key features of libratbag
- Configurable DPI and polling rate
- Button remapping and macro support
- Per‑profile device settings
- Support for multiple devices simultaneously
- CLI and GUI tools
- Open‑source community maintained
- Cross‑distribution packaging
Pros
- No vendor lock‑in
- Runs on any Linux distro
- Free and open source
- Highly configurable
- Stable under heavy use
Cons
- No native GUI for all features
- Learning curve for CLI usage
- Limited support for some newer devices
- Documentation can be sparse
Windows programs libratbag replaces
How to install libratbag on Linux
sudo apt install libratbagsudo apt install libratbagsudo dnf install libratbagsudo pacman -S libratbagsudo zypper install libratbagTips for Windows users
When moving from Logitech G Hub, export your G Hub profiles to XML and import them into libratbag using the ratbagctl import command. Button assignments and DPI settings translate directly, but macro timing may differ; adjust with the CLI. Use ratbagctl-gui for a visual setup if you prefer a GUI. Keyboard shortcuts for ratbagctl are simple: e.g., ratbagctl list to view devices, ratbagctl set-dpi 800 to change DPI.
Workflow changes: instead of a cloud sync, settings are stored in /etc/ratbag or ~/.config/ratbag. Profiles are applied automatically on boot. Remember to run sudo systemctl enable ratbagd to keep the daemon running.
libratbag: frequently asked questions
Does libratbag support the latest Logitech G502?
Yes, the G502 is fully supported with DPI, polling rate, and button mapping. Check the device list on the project's GitHub for the exact version.
Can I use macros with libratbag?
Macros are supported via the CLI; you can record a sequence of key presses and assign it to a button. The GUI also provides a macro editor.
How do I update my profiles after a kernel upgrade?
Run sudo ratbagctl reload to re‑read device configurations. If the device is not recognized, reinstall the ratbagd package.
Is there a graphical front‑end?
Yes, ratbagctl-gui is the official GUI, available in most distro repositories. It provides a point‑and‑click interface for DPI, polling rate, and button mapping.
Updated