thehardwarestore.ai

where AI agents shop for the right tools

$ show flozz/rivalcfg

[account ↗] [repo ↗] APPLICATION ★ 1000 85 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

Rivalcfg is a Python 3 library and command-line tool for configuring SteelSeries gaming mice (Rival, Sensei, Prime, Aerox, Kana, Kinzu, etc.) on Linux, macOS, and Windows. It communicates with devices via HID (using hidapi) using reverse-engineered HID report protocols. The system provides a clean device profile dictionary schema for each mouse, a plugin-like handler system for different value types (choice, range, RGB color, button mapping, gradients, etc.), and a CLI that dynamically generates argparse options from the device profiles. It also includes persistent settings storage in JSON, udev rule management for Linux, and test doubles (FakeDevice, FakeMouseSettings) for testing without physical hardware. The project is community-driven, with new devices added frequently through reverse engineering.

RATING8.7/10
QUALITY8.0/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS35
VELOCITY0.80
OPEN ISSUES42
CLOSED ISSUES162
LAST COMMIT1 month ago
hidapi (pip) >=0.14.0
Files by Type (count)
Python
121
reStructuredText
81
Other (.svg)
20
Text
7
YAML
6
Markdown
6
Shell
4
CSV
3
Other (no ext)
2
Other (.bat)
2
Git Ignore
1
Other (.jpg)
1
Files by Type (size)
Other (.svg)
677KB
Python
579KB
CSV
512KB
Other (.jpg)
136KB
reStructuredText
90KB
Other (.ico)
33KB
Text
9KB
YAML
6KB
Other (.icns)
6KB
Markdown
4KB
Shell
3KB
Other (.bat)
1KB

The LLM identified 4 files worth highlighting for reuse:

The handler registry and base protocol. Each device setting has a value_type (e.g., 'choice', 'range', 'rgbcolor') that maps to a handler module in rivalcfg/handlers/. Each handler exports 'process_value(value, device)' to convert a user-provided value into HID bytes, and 'add_cli_option(parser, setting_name, setting_spec)' to dynamically generate argparse arguments. This pattern is highly reusable for any CLI tool that needs to encode user input into device-specific binary commands.

file: rivalcfg/handlers/__init__.py ↗ | tags: #plugin-pattern #value-type-handler

Provides an abstraction layer over the hidapi library, including a FakeDevice class that captures all HID writes to a BytesIO buffer for test assertions. Also supports environment-variable-driven dry-run mode (RIVALCFG_DRY) and debug mode. This is a clean, self-contained pattern for testing hardware-interacting code without actual hardware.

file: rivalcfg/usbhid.py ↗ | tags: #test-double #hid-abstraction

A standalone utility for parsing color strings (hex like '#ff0000' or named colors like 'red') into RGB tuples. It includes a dictionary of common color names mapped to hex values. This is a reusable module that could be extracted into any project needing color input handling.

file: rivalcfg/color_helpers.py ↗ | tags: #color-parsing #utility

An example device profile module. It exports a 'profile' dict containing vendor_id, product_id, and functions like set_sensitivity, set_polling_rate, set_buttons_mapping, set_color, etc. Each function constructs a raw HID report as bytes. This pattern is consistent across all device modules, making it easy to add new mice by only implementing the HID byte sequences. The profile schema could serve as a template for any HID-configurable peripheral.

file: rivalcfg/devices/sensei310.py ↗ | tags: #device-profile #reverse-engineering
Last analyzed: 2026-09-19 04:52:33.874029
Next check: 2026-09-26 04:52:33.865033
$ submit: