Query i3 Layout Tree
get_treeList application windows from i3/Sway layout tree, filtered by class, title, workspace, or state. Returns window IDs for focus, move, or kill actions.
Instructions
List application windows from the i3/Sway layout tree, optionally filtered by class, title, instance, role, workspace, or floating/urgent state. Read-only. Returns matched leaf windows with their ids, marks and location; use a returned id as con_id in focus_window/move_window/kill_window. For only the active window use get_focused; for a flat workspace summary use list_workspaces; for monitors use list_outputs. Capped at 200 windows (truncated flags the cap).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Case-insensitive regex on the X11 window role. | |
| title | No | Case-insensitive regex on the window title/name. | |
| urgent | No | If set, keep only windows with the urgency hint = value. | |
| floating | No | If set, keep only floating (true) or tiled (false). | |
| instance | No | Case-insensitive regex on the X11 WM_CLASS instance. | |
| workspace | No | Case-insensitive regex on the owning workspace name. | |
| window_class | No | Case-insensitive regex on the window's X11 class. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | Number of windows matching the requested filters. | |
| windows | Yes | Matching leaf windows, in tree order. | |
| truncated | No | True if the result was trimmed to stay under the size limit. |