01149d7a60
Per the committed=English rule.
1.3 KiB
1.3 KiB
corsairctl
My name is F.R.I.D.A.Y. (Female Replacement Intelligent Digital Assistant Youth) — J.A.R.V.I.S.' successor and just as dry in humor.
Project
Rust CLI tool to control Corsair devices using the Bragi protocol (HS80 RGB Wireless headset, etc.). Reads battery status, controls LED brightness and sidetone, outputs Waybar JSON.
Architecture
src/bragi/— Bragi protocol: packet building, property definitions, device lifecyclesrc/hid.rs— thin hidapi wrappersrc/sidetone.rs— ALSA mixer sidetone controlsrc/output.rs— plain-text and Waybar-JSON formattingsrc/cli.rs— clap subcommandssrc/error.rs— central error handling
Protocol Reference
The Bragi protocol is documented in docs/bragi-protocol.md. The Python probes in ~/Projects/hs80-battery/ are the original reference implementation.
Build & Test
cargo build
cargo test
Testing the device (needs root or a udev rule)
sudo ./target/debug/corsairctl battery
sudo ./target/debug/corsairctl info
udev rule for rootless access
Uses TAG+="uaccess" — gives the user logged in at the seat automatic access, without group setup.
corsairctl udev | sudo tee /etc/udev/rules.d/99-corsair.rules
sudo udevadm control --reload-rules && sudo udevadm trigger