headroom/crates/headroom-client
2026-05-24 18:12:31 +10:00
..
src fix: further layer A (per-app) glitches 2026-05-24 18:12:31 +10:00
Cargo.toml stage 2 2026-05-19 16:33:09 +10:00
README.md stage 2 2026-05-19 16:33:09 +10:00

headroom-client

Blocking Rust client for the Headroom control protocol.

use headroom_client::{Client, Route};
use headroom_ipc::Topic;

let mut client = Client::connect()?;
println!("connected to headroom {}", client.hello().version);

client.profile_use("night")?;
client.route_set("firefox", Route::Processed)?;
client.subscribe(&[Topic::Meters])?;

loop {
    let event = client.next_event()?;
    println!("{}/{}: {}", event.topic, event.event, event.data);
}
# Ok::<(), headroom_client::ClientError>(())

The crate is a thin layer over headroom-ipc — it re-exports the wire types and adds a Client that owns a UnixStream, correlates responses by id, and queues stray events received while a request is in flight.

License

MPL-2.0. Safe to depend on from non-GPL clients.