wait_for
Avoid fixed sleeps by waiting for real desktop conditions: windows, text, widgets, focus, clipboard changes, or elapsed time. Returns when the condition is met or reports a timeout honestly.
Instructions
Wait until the desktop reaches a state, instead of sleeping a guessed number of seconds. Conditions: window_exists, window_gone, window_focused, focus_changes; text_appears (OCR polls a window for a string -- a reply arriving, a build finishing); widget_exists (an AT-SPI widget matching text/role shows up in app); clipboard_changed (a copy landed); elapsed (just wait N seconds -- for a long install with nothing to poll, and the honest alternative to watching for a string you know will never appear). Returns as soon as it is true, or reports honestly that it timed out. A timeout over 300s is clamped, not refused.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | For widget_exists: the AT-SPI application name | |
| role | No | For widget_exists: the widget role, e.g. 'push button' | |
| text | No | For text_appears: the string to watch for. For widget_exists: the widget name to match. | |
| target | No | ||
| timeout | No | ||
| condition | Yes |