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).

strict digraph window {
bgcolor="transparent"
node [pos="0,0!", color="Gray", fillcolor="Gray", href="root.html", style="filled", label="root", fontname="regular"];
root;

node [pos="-1.94,-0.44!", color="Gray", fillcolor="Gray", href="bars.html", style="filled", label="bar", fontname="regular"];
bar;

node [pos="-1.56,1.24!", color="Gray", fillcolor="Gray", href="backend.html", style="filled", label="core", fontname="regular"];
core;

node [pos="1.56,1.24!", color="OrangeRed", fillcolor="Orange", href="groups.html", style="filled", label="group", fontname="regular"];
group;

node [pos="1.94,-0.44!", color="Goldenrod", fillcolor="Gold", href="layouts.html", style="filled", label="layout", fontname="regular"];
layout;

node [pos="0.86,-1.8!", color="DarkGreen", fillcolor="LimeGreen", href="screens.html", style="filled", label="screen", fontname="regular"];
screen;

node [pos="-0.86,-1.8!", color="Gray", fillcolor="Gray", href="widgets.html", style="filled", label="widget", fontname="regular"];
widget;

node [pos="0,2!", color="Red", fillcolor="Tomato", href="windows.html", style="filled", label="window", fontname="bold"];
window;

root -> bar [color="Gray"];
root -> group [color="Gray"];
root -> layout [color="Gray"];
root -> screen [color="Gray"];
root -> widget [color="Gray"];
root -> window [color="Gray"];
root -> core [color="Gray"];
bar -> screen [color="Gray", dir="both"];
bar -> widget [color="Gray", dir="both"];
group -> layout [color="Gray", dir="both"];
group -> window [dir="both"];
group -> screen [color="Gray", dir="both"];
layout -> window [dir="both"];
layout -> screen [color="Gray", dir="both"];
screen -> window [dir="both"];
screen -> widget [color="Gray", dir="both"];
}

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_to_front()

Bring the window to the front.

center()

Centers a floating window on the screen.

commands()

Returns a list of possible commands for this object

disable_floating()

Tile the window.

disable_fullscreen()

Un-fullscreen the window

doc(name)

Returns the documentation for a specified command name

down_opacity()

Decrease the window's opacity by 10%.

enable_floating()

Float the window.

enable_fullscreen()

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_position()

Get the (x, y) of the window

get_size()

Get the (width, height) of the window

info()

Return information on this window.

is_visible()

Is this window visible (i.e. not hidden)?.

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_to_bottom()

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.

move_to_top()

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.

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_floating()

Toggle the floating state of the window.

toggle_fullscreen()

Toggle the fullscreen state of the window.

toggle_maximize()

Toggle the fullscreen state of the window.

toggle_minimize()

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.

up_opacity()

Increase the window's opacity by 10%.

Command documentation

abstractmethod 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.

center() None[source]

Centers a floating window on the screen.

commands() list[str]

Returns a list of possible commands for this object

Used by __qsh__ for command completion and online help

abstractmethod disable_floating() None[source]

Tile the window.

abstractmethod disable_fullscreen() None[source]

Un-fullscreen the window

doc(name) str

Returns the documentation for a specified command name

Used by __qsh__ to provide online help.

down_opacity() None[source]

Decrease the window's opacity by 10%.

abstractmethod enable_floating() None[source]

Float the window.

abstractmethod enable_fullscreen() None[source]

Fullscreen the window

eval(code: str) str | None

Evaluates code in the same context as this function

Return a string representing the return value of eval, or None if exec was used instead.

abstractmethod focus(warp: bool = True) None[source]

Focus this window and optional warp the pointer to it.

function(function, *args, **kwargs) Task | None

Call a function with current object as argument

abstractmethod get_position() tuple[int, int][source]

Get the (x, y) of the window

abstractmethod get_size() tuple[int, int][source]

Get the (width, height) of the window

abstractmethod 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

abstractmethod 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.

abstractmethod move_floating(dx: int, dy: int) None[source]

Move window by dx and dy

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.

abstractmethod place(x, y, width, height, borderwidth, bordercolor, above=False, margin=None, respect_hints=False)

Place the window in the given position.

abstractmethod resize_floating(dw: int, dh: int) None[source]

Add dw and dh to size of window

set_opacity(opacity: float) None[source]

Set the window's opacity

abstractmethod set_position(x: int, y: int) None[source]

Move floating window to x and y; swap tiling window with the window under the pointer.

abstractmethod set_position_floating(x: int, y: int) None[source]

Move window to x and y

abstractmethod set_size_floating(w: int, h: int) None[source]

Set window dimensions to w and h

abstractmethod 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.

abstractmethod toggle_floating() None[source]

Toggle the floating state of the window.

abstractmethod toggle_fullscreen() None[source]

Toggle the fullscreen state of the window.

abstractmethod toggle_maximize() None[source]

Toggle the fullscreen state of the window.

abstractmethod toggle_minimize() None[source]

Toggle the minimized state of the window.

abstractmethod 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)
toscreen(index: int | None = None) None[source]

Move window to a specified screen.

If index is not specified, we assume the current screen

Examples

Move window to current screen:

toscreen()

Move window to screen 0:

toscreen(0)
up_opacity() None[source]

Increase the window's opacity by 10%.