wait_for
Pause until a desktop event (window open/close, workspace change, layer, urgent, screencast) occurs, with optional match filter and timeout. Returns instantly if the condition already holds, avoiding missed events and polling.
Instructions
Block until a desktop event happens (real compositor events, not
polling). event: 'window_open' | 'window_close' | 'workspace' |
'title_change' | 'layer_open' | 'layer_close' (layer-shell surfaces:
launchers, notification popups; match on the namespace, e.g. 'wofi') |
'urgent' (a window demands attention) | 'screencast' (screen sharing
started/stopped). match: optional case-insensitive substring filter
over the event's fields (class/title/workspace name/address/namespace).
timeout_s 1-60, default 10. Returns the event payload, or a timeout
note; a filtered wait whose condition ALREADY holds (the window is
already gone, the workspace already active, the layer already mapped)
returns instantly with already: true instead of missing an event
that fired before it could subscribe. Use it after actions with
delayed effects: app startups, page loads that change a window title,
a launcher bind that pops a layer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event | Yes | ||
| match | No | ||
| timeout_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |