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

  See also

  https://i3wm.org/docs/ipc.html#_tree_reply

  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.

  coroutine command(command: str) → List[CommandReply]

    Runs a command on this container.

    See also

    https://i3wm.org/docs/userguide.html#list_of_commands

    Returns:

      A list of replies for each command in the given command string.

    Return type:

      list(CommandReply)

  coroutine command_children(command: str) → List[CommandReply]

    Runs a command on the immediate children of the currently selected container.

    See also

    https://i3wm.org/docs/userguide.html#list_of_commands

    Returns:

      A list of replies for each command that was executed.

    Return type:

      list(CommandReply)

  descendants() → List[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[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) → Con | None

    Finds a container with the given container id under this node.

    Returns:

      The container with this container id if it exists.

    Return type:

      `Con` or `None` if there is no container with this container id.

  find_by_pid(pid: int) → List[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[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) → Con | None

    Finds a container with the given window id under this node.

    Returns:

      The container with this window id if it exists.

    Return type:

      `Con` or `None` if there is no container with this window id.

  find_classed(pattern: str) → List[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() → Con | None

    Finds the focused container under this container if it exists.

    Returns:

      The focused container if it exists.

    Return type:

      `Con` or `None` if the focused container is not under this container

  find_fullscreen() → List[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[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[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[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[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[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() → Con

    Gets the root container.

    Returns:

      The root container.

    Return type:

      `Con`

  scratchpad() → Con

    Finds the scratchpad container.

    Returns:

      The scratchpad container.

    Return type:

      class:Con

  workspace() → Con | None

    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` or `None` if this container is above the workspace level.

  workspaces() → List[Con]

    Gets a list of workspace containers for this tree.

    Returns:

      A list of workspace containers.

    Return type:

      list(`Con`)