01149d7a60
Per the committed=English rule.
44 lines
1.3 KiB
Markdown
44 lines
1.3 KiB
Markdown
# 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 lifecycle
|
|
- `src/hid.rs` — thin hidapi wrapper
|
|
- `src/sidetone.rs` — ALSA mixer sidetone control
|
|
- `src/output.rs` — plain-text and Waybar-JSON formatting
|
|
- `src/cli.rs` — clap subcommands
|
|
- `src/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
|
|
|
|
```bash
|
|
cargo build
|
|
cargo test
|
|
```
|
|
|
|
## Testing the device (needs root or a udev rule)
|
|
|
|
```bash
|
|
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.
|
|
|
|
```bash
|
|
corsairctl udev | sudo tee /etc/udev/rules.d/99-corsair.rules
|
|
sudo udevadm control --reload-rules && sudo udevadm trigger
|
|
```
|