Next: , Previous: , Up: Windows   [Contents][Index]


8.2 Getting Windows

First, functions which treat all windows.

Function: managed-windows

Returns a list containing all managed window objects, in the order that they were adopted by the window manager (first to last).

Function: map-windows function

Call (function window) on all existing windows. Returns the value of the last function invocation. If any function returns nil, map-windows returns nil immediately.

Functions to get specific windows.

Function: get-window-by-id xid

Return a window object with ID xid, or nil.

Function: get-window-by-name name #!key regex icon

Return a window object with name name, or nil. Even if multiple windows are matched, one of them is returned.

If regex is non-nil, name is treated as a regex, and matched against window names.

If icon is non-nil, window’s icon name (set by NEW_WM_ICON_NAME, not EWMH _NET_WM_ICON_NAME) is searched, instead of the window’s name.

Function: get-window-by-class class #!regex

Same as the above, but the match is done against the window class. Here, the class does not include the “instance”. (See window-class in See Window Attributes.)

The option regex is boolean, not a regex, like get-window-by-name.

Function: get-window-by-role role

Same as the above, but the match is done against the window role.

The option regex is boolean, not a regex, like get-window-by-name.

Function: filter-windows pred

Return the list of windows (mapped or unmapped) that match the predicate function pred.