Skip to content

How-ToMouse

How to Configure a Gaming Mouse on Linux with Piper: DPI, Buttons and RGB

Piper is a free Linux app for setting a gaming mouse's DPI, profiles, buttons and LED colours, working through the libratbag daemon. We explain how to check your mouse is supported, install Piper and ratbagd, fix the mousetrap and API version errors, and troubleshoot with ratbagctl.

By , Systems & Technical Editor

4 min read

How to Configure a Gaming Mouse on Linux with Piper: DPI, Buttons and RGB

Most gaming mouse software, including Logitech G HUB and Razer Synapse 4, doesn't run on Linux. Piper fills part of that gap. It's a free, open-source app that changes a supported mouse's DPI, profiles, button behaviour and LED colours. Piper itself is only the window you click in. The real work happens in libratbag, a background service that knows how to talk to each mouse, so most of this guide is about getting that service right.

We used the Piper and libratbag GitHub repositories, their wikis and FAQ, libratbag's device files and Piper's Flathub listing, all checked on 2 December 2026.

How Piper and libratbag fit together

libratbag provides ratbagd, a DBus daemon for configuring input devices, mainly gaming mice. Piper sends your changes over DBus to ratbagd. ratbagd then uses libratbag and a device-specific protocol driver to write the settings to the mouse.

That has two practical effects:

  • Device support comes from libratbag, not Piper. Piper's FAQ is blunt: if your mouse doesn't show up in Piper, it's almost always because libratbag doesn't support it, and bugs should be filed against libratbag.

  • ratbagd must be installed and running before you open Piper.

Step 1: Check your mouse is supported

libratbag's README lists support for devices from Logitech, Etekcity, G.Skill, Roccat and SteelSeries. Its data/devices folder on GitHub holds a .device file for each known model, and also includes ASUS ROG and TUF mice and several Glorious models. Search that folder for your mouse before you install anything.

Two Logitech G mice in our specs database have device files: the Logitech G305 Lightspeed and the Logitech G502 X Lightspeed, listed as "Logitech G502 X Wireless". Both use libratbag's HID++ 2.0 driver. The G305 file sets its LED count to zero, which fits a mouse with no RGB lighting.

The projects warn that device protocols usually have to be reverse-engineered, so the features Piper shows may differ from what the manufacturer advertises for the same mouse.

Step 2: Install Piper and ratbagd

The Piper wiki says to use your distribution's repository where possible:

Distribution

Command

Fedora

dnf install piper

Arch

pacman -S piper

Debian 11 or later

sudo apt install piper

Ubuntu 20.04 or later (universe)

sudo apt install piper

openSUSE

zypper install piper

Solus

eopkg it piper

Piper is also on Flathub, but ratbagd can't be packaged as a Flatpak. If you use the Flatpak, install libratbag yourself, and make sure it's the latest release. The Flathub page notes the Flatpak is a community package that the libratbag developers don't verify or support. At the time of writing, the newest tags on GitHub are Piper 0.8 and libratbag v0.18.

Step 3: Make sure ratbagd is running

libratbag is designed to run ratbagd as a DBus-activated systemd service. If you built libratbag from source, its README says to run sudo systemctl daemon-reload and sudo systemctl reload dbus.service, then enable the service with sudo systemctl enable ratbagd.service.

If Piper opens to a picture of a mousetrap, something is wrong. The Piper README says this usually means ratbagd isn't running, ratbagd needs updating, or another error has occurred.

Step 4: Set DPI, profiles, buttons and LEDs

With ratbagd running and a supported mouse connected, open Piper. Its Flathub description lists four main jobs:

  • Resolution (DPI): change the mouse's DPI steps.

  • Profiles: add and remove profiles on mice that store more than one.

  • Buttons: change what each button does.

  • LEDs: set LED colours on mice with lighting.

Exactly which options appear depends on the device and how much of its protocol libratbag understands.

The libratbag documentation we used doesn't say where each model keeps these settings, so after a reboot, check that your DPI and button changes are still there. If you have a Logitech G mouse, our guide to Logitech G onboard memory explains how Logitech handles stored profiles.

Step 5: Troubleshoot with ratbagctl

Piper's FAQ says that 99% of the time, a mouse that doesn't work properly in Piper is a libratbag issue. Run ratbagctl list to see whether ratbagd detects the mouse, and ratbagctl info to see what it exposes. If the mouse is missing or shows incomplete information, report it to libratbag.

If Piper refuses to start with an "Incompatible ratbagd API version" error, the two components don't match. The ratbagd DBus API isn't stable yet, so the FAQ sets three rules:

  • If you run either from git, run the other from git too.

  • If you run a specific libratbag release, use the Piper release made for it.

  • If you run the Piper Flatpak, use the most recent libratbag release.

What about Logitech mice and Solaar?

Logitech owners have a second option, Solaar, which focuses on Logitech receivers, pairing, battery levels and settings such as scroll wheels. Both apps talk to Logitech devices using HID++. Solaar's documentation warns that if a device's state is changed by other means, Solaar's cached information about it can become incorrect until Solaar restarts. So it's simplest to set up each Logitech mouse with only one of the two apps. Our Solaar guide covers it, and Solaar vs Piper explains which to choose. For more Linux gaming software, see our best free Linux gaming tools.

The bottom line

To configure a gaming mouse on Linux, first check libratbag's device files for your model, because Piper is only a front end and supports nothing libratbag doesn't. Install Piper from your distribution's repository, or use the Flatpak with the latest libratbag installed separately. Make sure ratbagd is running (a mousetrap image means it isn't), then set DPI, profiles, button actions and LED colours in Piper. If the mouse is missing or incomplete, check ratbagctl list and ratbagctl info and report the problem to libratbag. Keep Piper and libratbag versions matched.

In this article

Sources

  1. 01libratbag, Piper GitHub repository README
  2. 02libratbag, Piper wiki: Installation
  3. 03libratbag, Piper wiki: FAQ
  4. 04libratbag, libratbag GitHub repository README
  5. 05libratbag, Supported device files (data/devices)
  6. 06Flathub, Piper

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

Solaar vs Piper: Which Linux App Should You Use for Your Mouse?

Versus

Solaar vs Piper: Which Linux App Should You Use for Your Mouse?

Solaar and Piper are the two main open-source Linux apps for configuring a mouse. We compare brand and device support, pairing, battery, DPI, buttons, profiles, lighting, rules, setup and how they overlap on Logitech mice, and explain which one suits which owner.

Callum Reid4 min

How to Set Up a Logitech Mouse or Keyboard on Linux with Solaar

How-To

How to Set Up a Logitech Mouse or Keyboard on Linux with Solaar

Logitech's G HUB app doesn't run on Linux, but the open-source Solaar does much of the same job. We explain how to install it, add its udev rule, get the tray icon working on GNOME, pair devices with Unifying, Bolt and Lightspeed receivers, and change DPI, buttons and onboard profiles.

Marcus Thorne6 min