Skip to main content

Crate wayle_hyprland

Crate wayle_hyprland 

Source
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 windows
  • monitors - Connected displays
  • layers - 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.
BindData
Keybind configuration from Hyprland.
Client
A Hyprland client window with reactive state.
CursorPosition
Cursor position in global layout coordinates.
DeviceInfo
Container for all input device information from Hyprland.
HyprlandService
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.
WorkspaceInfo
Workspace information for a monitor.
WorkspaceRule
A workspace rule from Hyprland configuration.

Enums§

Error
Hyprland service errors
HyprlandEvent
Structured events emitted by Hyprland
ScreencastOwner
The type of screencopy share.

Type Aliases§

FocusHistoryId
Focus history identifier.
MonitorId
Unique identifier for a monitor.
ProcessId
Process identifier.
Result
Result type alias for Hyprland operations.
WorkspaceId
Unique identifier for a workspace.