Con¶
- class i3ipc.Con(data, parent, conn)¶
A container of a window and child containers gotten from
i3ipc.Connection.get_tree()
or events.- Variables
border (str) –
current_border_width –
floating (str) – Either “auto_off”, “auto_on”, “user_off”, or “user_on”.
focus (list(int)) – The focus stack for this container as a list of container ids. The “focused inactive” is at the top of the list which is the container that would be focused if this container recieves focus.
focused (bool) –
fullscreen_mode (int) –
id (int) –
layout (str) –
marks (list(str)) –
name (str) –
num (int) –
orientation (str) –
percent (float) –
scratchpad_state (str) –
shell (str) – (sway only)
sticky (bool) –
type (str) –
urgent (bool) –
window (int) –
nodes (list(
Con
)) –floating_nodes (list(
Con
)) –window_class (str) –
window_instance (str) –
window_role (str) –
window_title (str) –
rect (
Rect
) –window_rect (
Rect
) –deco_rect (
Rect
) –geometry (
Rect
) –app_id (str) – (sway only)
pid (int) – (sway only)
gaps (
Gaps
) – (gaps only)representation (str) – (sway only)
visible (bool) – (sway only)
ipc_data (dict) – The raw data from the i3 ipc.
- command(command: str) List[i3ipc.replies.CommandReply] ¶
Runs a command on this container.
- Returns
A list of replies for each command in the given command string.
- Return type
list(
CommandReply
)
- command_children(command: str) List[i3ipc.replies.CommandReply] ¶
Runs a command on the immediate children of the currently selected container.
- Returns
A list of replies for each command that was executed.
- Return type
list(
CommandReply
)
- descendants() List[i3ipc.con.Con] ¶
Gets a list of all child containers for the container in breadth-first order.
- Returns
A list of descendants.
- Return type
list(
Con
)
- descendents() List[i3ipc.con.Con] ¶
Gets a list of all child containers for the container in breadth-first order.
Deprecated since version 2.0.1: Use
descendants()
instead.- Returns
A list of descendants.
- Return type
list(
Con
)
- find_by_id(id: int) Optional[i3ipc.con.Con] ¶
Finds a container with the given container id under this node.
- Returns
The container with this container id if it exists.
- Return type
Con
orNone
if there is no container with this container id.
- find_by_pid(pid: int) List[i3ipc.con.Con] ¶
Finds all the containers under this node with this pid.
- Returns
A list of containers with this pid.
- Return type
list(
Con
)
- find_by_role(pattern: str) List[i3ipc.con.Con] ¶
Finds all the containers under this node with a window role that matches the given regex pattern.
- Returns
A list of containers that have a window role that matches the pattern.
- Return type
list(
Con
)
- find_by_window(window: int) Optional[i3ipc.con.Con] ¶
Finds a container with the given window id under this node.
- Returns
The container with this window id if it exists.
- Return type
Con
orNone
if there is no container with this window id.
- find_classed(pattern: str) List[i3ipc.con.Con] ¶
Finds all the containers under this node with a window class, or app_id that matches the given regex pattern.
- Returns
A list of containers that have a window class, or app_id that matches the pattern.
- Return type
list(
Con
)
- find_focused() Optional[i3ipc.con.Con] ¶
Finds the focused container under this container if it exists.
- Returns
The focused container if it exists.
- Return type
Con
orNone
if the focused container is not under this container
- find_fullscreen() List[i3ipc.con.Con] ¶
Finds all the containers under this node that are in fullscreen mode.
- Returns
A list of fullscreen containers.
- Return type
list(
Con
)
- find_instanced(pattern: str) List[i3ipc.con.Con] ¶
Finds all the containers under this node with a window instance that matches the given regex pattern.
- Returns
A list of containers that have a window instance that matches the pattern.
- Return type
list(
Con
)
- find_marked(pattern: str = '.*') List[i3ipc.con.Con] ¶
Finds all the containers under this node with a mark that matches the given regex pattern.
- Returns
A list of containers that have a mark that matches the pattern.
- Return type
list(
Con
)
- find_named(pattern: str) List[i3ipc.con.Con] ¶
Finds all the containers under this node with a name that matches the given regex pattern.
- Returns
A list of containers that have a name that matches the pattern.
- Return type
list(
Con
)
- find_titled(pattern: str) List[i3ipc.con.Con] ¶
Finds all the containers under this node with a window title that matches the given regex pattern.
- Returns
A list of containers that have a window title that matches the pattern.
- Return type
list(
Con
)
- is_floating() bool ¶
A boolean value of whether this is a floating node.
- Returns
Whether this is a floating node
- Return type
bool
- leaves() List[i3ipc.con.Con] ¶
Gets a list of leaf child containers for this container in breadth-first order. Leaf containers normally contain application windows.
- Returns
A list of leaf descendants.
- Return type
list(
Con
)
- root() i3ipc.con.Con ¶
Gets the root container.
- Returns
The root container.
- Return type
- scratchpad() i3ipc.con.Con ¶
Finds the scratchpad container.
- Returns
The scratchpad container.
- Return type
class:Con
- workspace() Optional[i3ipc.con.Con] ¶
Finds the workspace container for this node if this container is at or below the workspace level.
- Returns
The workspace container if it exists.
- Return type
Con
orNone
if this container is above the workspace level.
- workspaces() List[i3ipc.con.Con] ¶
Gets a list of workspace containers for this tree.
- Returns
A list of workspace containers.
- Return type
list(
Con
)
- class i3ipc.Rect(data)¶
Used by other classes to represent rectangular position and dimensions.
- Variables
x (int) – The x coordinate.
y (int) – The y coordinate.
height (int) – The height of the rectangle.
width (int) – The width of the rectangle.
- class i3ipc.Gaps(data)¶
For forks that have useless gaps, the dimension of the gaps.
- Variables
inner (int) – The inner gaps.
outer (int) – The outer gaps.
left (int or
None
if not supported.) – The left outer gaps.right (int or
None
if not supported.) – The right outer gaps.top (int or
None
if not supported.) – The top outer gaps.bottom (int or
None
if not supported.) – The bottom outer gaps.