Expand description
Reactive bindings to Hyprland compositor state via IPC.
§Overview
Connects to Hyprland’s Unix domain sockets to query state and receive events.
State is exposed through reactive Property fields that update automatically
when Hyprland emits relevant events.
§Reactive Properties
All state fields use Property<T> which supports two access patterns:
- Snapshot:
property.get()returns the current value - Stream:
property.watch()returns a stream that yields on changes
let service = HyprlandService::new().await?;
// Get current workspaces
let workspaces = service.workspaces.get();
// Watch for workspace changes
let mut stream = service.workspaces.watch();
while let Some(workspaces) = stream.next().await {
println!("Workspaces changed: {:?}", workspaces.len());
}§Service Fields
The HyprlandService exposes:
workspaces- All workspaces (normal and special)clients- All open windowsmonitors- Connected displayslayers- Layer shell surfaces (panels, overlays, etc.)
§Event Streaming
Raw Hyprland events can be streamed via HyprlandService::events():
let service = HyprlandService::new().await?;
let mut events = service.events();
while let Some(event) = events.next().await {
println!("Event: {:?}", event);
}§IPC Commands
Execute Hyprland commands via HyprlandService::dispatch():
let service = HyprlandService::new().await?;
service.dispatch("workspace 1").await?;Structs§
- Address
- Window address identifier.
- Bind
Data - Keybind configuration from Hyprland.
- Client
- A Hyprland client window with reactive state.
- Cursor
Position - Cursor position in global layout coordinates.
- Device
Info - Container for all input device information from Hyprland.
- Hyprland
Service - Hyprland compositor service. See crate-level docs for usage.
- Monitor
- A Hyprland monitor (display output) with reactive state.
- Workspace
- A Hyprland workspace with reactive state.
- Workspace
Info - Workspace information for a monitor.
- Workspace
Rule - A workspace rule from Hyprland configuration.
Enums§
- Error
- Hyprland service errors
- Hyprland
Event - Structured events emitted by Hyprland
- Screencast
Owner - The type of screencopy share.
Type Aliases§
- Focus
History Id - Focus history identifier.
- Monitor
Id - Unique identifier for a monitor.
- Process
Id - Process identifier.
- Result
- Result type alias for Hyprland operations.
- Workspace
Id - Unique identifier for a workspace.