aio.Con¶
-
class
i3ipc.aio.
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 (bool) –
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) –
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
) –app_id (str) – (sway only)
pid (int) – (sway only)
gaps (
Gaps
) – (gaps only)ipc_data (dict) – The raw data from the i3 ipc.
-
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 that matches the given regex pattern.
- Returns
A list of containers that have a window class 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
)
-
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
)
-
scratchpad
() → i3ipc.con.Con¶ Finds the scratchpad container.
- Returns
The scratchpad container.
- Return type
class:Con