# i3wm segments

powerline.segments.i3wm.active_window(pl, cutoff=100)

  Returns the title of the currently active window.

  Parameters:

    cutoff (int) – Maximum title length. If the title is longer, the window_class is used instead.

  Highlight groups used: `active_window_title`.

powerline.segments.i3wm.mode(pl, segment_info, names={'default': None})

  Returns current i3 mode

  Parameters:

    names (dict) – Specifies the string to show for various modes. Use `null` to hide a mode (`default` is hidden by default).

  Highligh groups used: `mode`

powerline.segments.i3wm.scratchpad(pl, icons={'changed': 'X', 'fresh': 'O'})

  Returns the windows currently on the scratchpad

  Parameters:

    icons (dict) – Specifies the strings to show for the different scratchpad window states. Must contain the keys `fresh` and `changed`.

  Highlight groups used: `scratchpad` or `scratchpad:visible`, `scratchpad` or `scratchpad:focused`, `scratchpad` or `scratchpad:urgent`.

powerline.segments.i3wm.workspace(pl, segment_info, workspace=None, strip=False, format=None, icons={'multiple': 'M'})

  Return the specified workspace name

  Parameters:

    - workspace (str) – Specifies which workspace to show. If unspecified, may be set by the `list_workspaces` lister if used, otherwise falls back to currently focused workspace.

    - strip (bool) – Specifies whether workspace numbers (in the `1: name` format) should be stripped from workspace names before being displayed. Defaults to false. Deprecated: Use {name} or {stripped_name} of format instead.

    - format (str) – Specifies the format used to display workspaces; defaults to `{name}`. Valid fields are: `name` (workspace name), `number` (workspace number if present), stipped_name` (workspace name stripped of leading number), `icon` (if available, icon for application running in the workspace, uses the `multiple` icon instead of multiple different icons), `multi_icon` (similar to `icon`, but does not use `multiple`, instead joins all icons with a single space)

    - icons (dict) – A dictionary mapping a substring of window classes to strings to be used as an icon for that window class. Further, there is a `multiple` icon for workspaces containing more than one window.

  Highlight groups used: `workspace` or `w_visible`, `workspace:visible`, `workspace` or `w_focused`, `workspace:focused`, `workspace` or `w_urgent`, `workspace:urgent`, `workspace`.

powerline.segments.i3wm.workspaces(pl, segment_info, only_show=None, output=None, strip=0, format='{name}', icons={'multiple': 'M'}, sort_workspaces=False, show_output=False, priority_workspaces=[], hide_empty_workspaces=False)

  Return list of used workspaces

  Parameters:

    - only_show (list) – Specifies which workspaces to show. Valid entries are `"visible"`, `"urgent"` and `"focused"`. If omitted or `null` all workspaces are shown.

    - output (str) – May be set to the name of an X output. If specified, only workspaces on that output are shown. Overrides automatic output detection by the lemonbar renderer and bindings. Use “__all__” to show workspaces on all outputs.

    - strip (int) – Specifies how many characters from the front of each workspace name should be stripped (e.g. to remove workspace numbers). Defaults to zero.

    - format (str) – Specifies the format used to display workspaces; defaults to `{name}`. Valid fields are: `name` (workspace name), `number` (workspace number if present), stipped_name` (workspace name stripped of leading number), `icon` (if available, icon for application running in the workspace, uses the `multiple` icon instead of multiple different icons), `multi_icon` (similar to `icon`, but does not use `multiple`, instead joins all icons with a single space)

    - icons (dict) – A dictionary mapping a substring of window classes to strings to be used as an icon for that window class. Further, there is a `multiple` icon for workspaces containing more than one window.

    - sort_workspaces (bool) – Sort the workspaces displayed by their name according to the natural ordering.

    - show_output (bool) – Shows the name of the output if more than one output is connected.

    - priority_workspaces (list) – A list of workspace names to be sorted before any other workspaces in the given order.

    - hide_empty_workspaces (bool) – Hides all workspaces without any open window. Also hides non-focussed workspaces containing only an open scratchpad.

  Highlight groups used: `workspace` or `w_visible`, `workspace:visible`, `workspace` or `w_focused`, `workspace:focused`, `workspace` or `w_urgent`, `workspace:urgent`, `workspace` or `output`.