Window objects
The size and position of windows is determined by the current layout. Nevertheless, windows can still change their appearance in multiple ways (toggling floating state, fullscreen, opacity).
Windows can access objects relevant to the display of the window (i.e. the screen, group and layout).
- class libqtile.backend.base.window.Window[source]
API commands
To access commands on this object via the command graph, use one of the following options:
lazy.window.<command>()
qtile cmd-obj -o window -f <command>
The following commands are available for this object:
Bring the window to the front.
center
()Centers a floating window on the screen.
commands
()Returns a list of possible commands for this object
Tile the window.
Un-fullscreen the window
doc
(name)Returns the documentation for a specified command name
Decrease the window's opacity by 10%.
Float the window.
Fullscreen the window
eval
(code)Evaluates code in the same context as this function
focus
([warp])Focus this window and optional warp the pointer to it.
function
(function, *args, **kwargs)Call a function with current object as argument
Get the (x, y) of the window
get_size
()Get the (width, height) of the window
info
()Return information on this window.
Is this window visible (i.e.
items
(name)Build a list of contained items for the given item class.
keep_above
([enable])Keep this window above all others
keep_below
([enable])Keep this window below all others
kill
()Kill the window
move_down
([force])Move this window below the previous window along the z axis.
move_floating
(dx, dy)Move window by dx and dy
Move this window below all windows in the current layer e.g.
Move this window above all windows in the current layer e.g.
move_up
([force])Move this window above the next window along the z axis.
place
(x, y, width, height, borderwidth, ...)Place the window in the given position.
resize_floating
(dw, dh)Add dw and dh to size of window
set_opacity
(opacity)Set the window's opacity
set_position
(x, y)Move floating window to x and y; swap tiling window with the window under the pointer.
set_position_floating
(x, y)Move window to x and y
set_size_floating
(w, h)Set window dimensions to w and h
static
([screen, x, y, width, height])Makes this window a static window, attached to a Screen.
Toggle the floating state of the window.
Toggle the fullscreen state of the window.
Toggle the fullscreen state of the window.
Toggle the minimized state of the window.
togroup
([group_name, switch_group, toggle])Move window to a specified group
toscreen
([index])Move window to a specified screen.
Increase the window's opacity by 10%.
Command documentation
- abstract bring_to_front() None
Bring the window to the front.
In X11, bring_to_front ignores all other layering rules and brings the window to the very front. When that window loses focus, it will be stacked again according the appropriate rules.
- commands() list[str]
Returns a list of possible commands for this object
Used by __qsh__ for command completion and online help
- doc(name) str
Returns the documentation for a specified command name
Used by __qsh__ to provide online help.
- eval(code: str) tuple[bool, str | None]
Evaluates code in the same context as this function
Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.
- abstract focus(warp: bool = True) None [source]
Focus this window and optional warp the pointer to it.
- function(function, *args, **kwargs) None
Call a function with current object as argument
- abstract info() dict[str, Any]
Return information on this window.
Mimimum required keys are: - name - x - y - width - height - group - id - wm_class
- is_visible() bool
Is this window visible (i.e. not hidden)?
- items(name: str) tuple[bool, list[str | int] | None]
Build a list of contained items for the given item class.
Exposing this allows __qsh__ to navigate the command graph.
Returns a tuple (root, items) for the specified item class, where:
root: True if this class accepts a "naked" specification without an item seletion (e.g. "layout" defaults to current layout), and False if it does not (e.g. no default "widget").
items: a list of contained items
- keep_above(enable: bool | None = None)
Keep this window above all others
- keep_below(enable: bool | None = None)
Keep this window below all others
- abstract kill() None
Kill the window
- move_down(force: bool = False) None
Move this window below the previous window along the z axis.
Will not lower a "normal" window (i.e. one that is not "kept_above/below") below a window that is marked as "kept_below".
Will not lower a window where "keep_above" is True unless force is set to True.
- move_to_bottom() None
Move this window below all windows in the current layer e.g. if you have 3 windows all with "keep_above" set, calling this method will move the window to the bottom of those three windows.
Calling this on a "normal" window will not raise it below a "kept_below" window.
- move_to_top() None
Move this window above all windows in the current layer e.g. if you have 3 windows all with "keep_above" set, calling this method will move the window to the top of those three windows.
Calling this on a "normal" window will not raise it above a "kept_above" window.
- move_up(force: bool = False) None
Move this window above the next window along the z axis.
Will not raise a "normal" window (i.e. one that is not "kept_above/below") above a window that is marked as "kept_above".
Will not raise a window where "keep_below" is True unless force is set to True.
- abstract place(x, y, width, height, borderwidth, bordercolor, above=False, margin=None, respect_hints=False)
Place the window in the given position.
- abstract set_position(x: int, y: int) None [source]
Move floating window to x and y; swap tiling window with the window under the pointer.
- abstract static(screen: int | None = None, x: int | None = None, y: int | None = None, width: int | None = None, height: int | None = None) None [source]
Makes this window a static window, attached to a Screen.
Values left unspecified are taken from the existing window state.
- abstract togroup(group_name: str | None = None, switch_group: bool = False, toggle: bool = False) None [source]
Move window to a specified group
Also switch to that group if switch_group is True.
If toggle is True and and the specified group is already on the screen, use the last used group as target instead.
Examples
Move window to current group:
togroup()
Move window to group "a":
togroup("a")
Move window to group "a", and switch to group "a":
togroup("a", switch_group=True)