A tiny Linux utility for applying Razer mouse DPI and polling-rate settings directly over USB.
No GUI, daemon, or background service: read a small config file, send the HID reports, and exit.
| 🎯 DPI | Applies the same non-zero u16 DPI value to the X and Y axes. |
| ⚡ Polling | Supports 125, 250, 500, 1000, 2000, 4000, and 8000 Hz. |
| 💾 Onboard profiles | Sends polling reports for both onboard selectors used by the current protocol implementation. |
| 🪶 Small footprint | Uses rusb and exits after applying the settings. |
The detector currently accepts Razer vendor ID 1532 with these two product IDs:
| Connection | USB ID |
|---|---|
| Wired | 1532:00c0 |
| Wireless | 1532:00c1 |
Hardware warning: protocol commands are device-specific. Do not assume another Razer mouse is compatible merely because it shares the vendor ID.
Install a Rust toolchain and your distribution's libusb development package, then build:
cargo build --releaseThe binary is written to target/release/razer-h.
On the first run, razer-h asks for a polling rate and DPI, then creates:
~/.config/razer-hThe file format is deliberately simple:
dpi=1600
poll_rate=8000Run without arguments to load and apply the saved values:
./target/release/razer-hIf a saved value is missing or invalid, the current fallback is 1600 DPI and 8000 Hz. Command-line arguments are not implemented yet.
The process must be allowed to open the device and claim HID interface 2. If it reports a permission or claim error, configure an appropriate udev rule for the exact device IDs above or run it temporarily with sufficient privileges while testing.
cargo fmt --all --check
cargo test
cargo clippy --all-targetsThis is an early, intentionally narrow utility. Detection is limited to two product IDs, settings are file-based, and there is no CLI parser or broad device database yet.