Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖱️ razer-h

A tiny Linux utility for applying Razer mouse DPI and polling-rate settings directly over USB.

Rust 2024 Linux libusb Polling rate up to 8 kHz

No GUI, daemon, or background service: read a small config file, send the HID reports, and exit.


What it does

🎯 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.

Current device scope

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.

Build

Install a Rust toolchain and your distribution's libusb development package, then build:

cargo build --release

The binary is written to target/release/razer-h.

Configure and run

On the first run, razer-h asks for a polling rate and DPI, then creates:

~/.config/razer-h

The file format is deliberately simple:

dpi=1600
poll_rate=8000

Run without arguments to load and apply the saved values:

./target/release/razer-h

If a saved value is missing or invalid, the current fallback is 1600 DPI and 8000 Hz. Command-line arguments are not implemented yet.

USB permissions

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.

Development

cargo fmt --all --check
cargo test
cargo clippy --all-targets

Project status

This 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.

Set it once. Keep the stack small.

About

A small tool for my razer mouse (Viper V3 pro) that allows me to permanently change the polling rate and the dpi without running a permanent backgroud service.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages