Skip to content

Widget objects

Widgets are small scripts that are used to provide content or add functionality to the bar. Some widgets will expose commands in order for functionality to be triggered indirectly (e.g. via a keypress).

Widgets can access the parent bar and screen via the command graph.

.. qtile_graph:: :root: widget

widget

Modules:

  • backlight –
  • base –
  • battery –
  • bluetooth –
  • canto –
  • caps_num_lock_indicator –
  • check_updates –
  • chord –
  • clipboard –
  • clock –
  • cmus –
  • config_error –
  • countdown –
  • cpu –
  • crashme –
  • crypto_ticker –
  • currentlayout –
  • currentscreen –
  • df –
  • do_not_disturb –
  • generic_poll_text –
  • gmail_checker –
  • graph –
  • groupbox –
  • hdd –
  • idlerpg –
  • image –
  • imapwidget –
  • import_error –
  • keyboardkbdd –
  • keyboardlayout –
  • khal_calendar –
  • launchbar –
  • load –
  • maildir –
  • memory –
  • moc –
  • mpd2widget –

    A widget for Music Player Daemon (MPD) based on python-mpd2.

  • mpris2widget –
  • net –
  • notify –
  • nvidia_sensors –
  • open_weather –
  • pomodoro –
  • prompt –
  • pulse_volume –
  • quick_exit –
  • screensplit –
  • sensors –
  • sep –
  • she –
  • spacer –
  • statusnotifier –
  • stock_ticker –
  • systray –
  • tasklist –
  • textbox –
  • thermal_zone –
  • volume –
  • wallpaper –
  • widgetbox –
  • window_count –
  • windowname –
  • windowtabs –
  • wlan –
  • wttr –

Classes:

  • AGroupBox –

    A widget that graphically displays the current group.

  • Backlight –

    A simple widget to show the current brightness of a monitor.

  • Battery –

    A text-based battery monitoring widget supporting both Linux and FreeBSD.

  • BatteryIcon –

    Battery life indicator widget.

  • Bluetooth –

    Bluetooth widget that provides following functionality:

  • CPU –

    A simple widget to display CPU load and frequency.

  • CPUGraph –

    Display CPU usage graph.

  • Canto –

    Display RSS feeds updates using the canto console reader.

  • CapsNumLockIndicator –

    Really simple widget to show the current Caps/Num Lock state.

  • CheckUpdates –
  • Chord –

    Display current key chord.

  • Clipboard –

    Display current clipboard contents.

  • Clock –

    A simple but flexible text-based clock.

  • Cmus –

    A simple Cmus widget.

  • Countdown –

    A simple countdown timer text widget.

  • CryptoTicker –

    A cryptocurrency ticker widget, data provided by the coinbase.com or the binance.com

  • CurrentLayout –

    Display the name of the current layout of the current group of the screen,

  • CurrentLayoutIcon –

    Display the icon representing the current layout of the

  • CurrentScreen –

    Indicates whether the screen this widget is on is currently active or not.

  • DF –

    Disk Free Widget.

  • DoNotDisturb –

    Displays Do Not Disturb status for notification server Dunst by default.

  • GenPollCommand –

    A generic text widget to display output from scripts or shell commands.

  • GenPollText –

    A generic text widget that polls using poll function to get the text.

  • GenPollUrl –

    A generic text widget that polls an url and parses it using parse function.

  • GmailChecker –

    A simple gmail checker. If 'status_only_unseen' is True - set 'fmt' for one

  • GroupBox –

    A widget that graphically displays the current group.

  • HDD –

    Displays HDD usage in percent based on the number of milliseconds the device has been performing I/O operations.

  • HDDBusyGraph –

    Display HDD busy time graph.

  • HDDGraph –

    Display HDD free or used space graph.

  • IdleRPG –

    A widget for monitoring and displaying IdleRPG stats.

  • Image –

    Display a PNG image on the bar.

  • ImapWidget –

    Email IMAP widget.

  • KeyboardKbdd –

    Widget for changing keyboard layouts per window, using kbdd.

  • KeyboardLayout –

    Widget for changing and displaying the current keyboard layout.

  • KhalCalendar –

    Khal calendar widget.

  • LaunchBar –

    This module defines a widget that displays icons to launch softwares or commands

  • Load –

    A small widget to show the load averages of the system.

  • Maildir –

    A simple widget showing the number of new mails in maildir mailboxes.

  • Memory –

    Display memory/swap usage.

  • MemoryGraph –

    Displays a memory usage graph.

  • Mirror –

    A widget for showing the same widget content in more than one place, for

  • Moc –

    A simple MOC widget.

  • Mpd2 –

    Mpd2 Object.

  • Mpris2 –

    An MPRIS 2 widget.

  • Net –

    Displays interface down and up speed.

  • NetGraph –

    Display a network usage graph.

  • Notify –

    A notify widget.

  • NvidiaSensors –

    Displays temperature, fan speed and performance level Nvidia GPU.

  • OpenWeather –

    A weather widget, data provided by the OpenWeather API.

  • Pomodoro –

    Pomodoro technique widget.

  • Prompt –

    A widget that prompts for user input.

  • PulseVolume –

    Volume widget for systems using PulseAudio.

  • QuickExit –

    A button to shut down Qtile. When clicked, a countdown starts. Clicking

  • ScreenSplit –

    A simple widget to show the name of the current split and layout for the

  • Sep –

    A visible widget separator.

  • She –

    Widget to display the Super Hybrid Engine status.

  • Spacer –

    Just an empty space on the bar.

  • StatusNotifier –

    A 'system tray' widget using the freedesktop StatusNotifierItem

  • StockTicker –

    A stock ticker widget, based on the alphavantage API. Users must acquire an

  • SwapGraph –

    Display a swap info graph.

  • Systray –

    A widget that manages system tray.

  • TaskList –

    Displays the icon and name of each window in the current group.

  • TextBox –

    A flexible textbox that can be updated from bound keys, scripts, and qshell.

  • ThermalSensor –

    Widget to display temperature sensor information.

  • ThermalZone –

    Thermal zone widget.

  • Volume –

    Widget that display and change volume.

  • Wallpaper –
  • WidgetBox –

    A widget to declutter your bar.

  • WindowCount –

    A simple widget to display the number of windows in the

  • WindowName –

    Displays the name of the window that currently has focus.

  • WindowTabs –

    Displays the name of each window in the current group.

  • Wlan –

    Displays Wifi SSID and quality.

  • Wttr –

    Display weather widget provided by wttr.in.

AGroupBox

AGroupBox(**config)

Bases: _GroupBase

A widget that graphically displays the current group.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Backlight

Backlight(**config)

Bases: InLoopPollText

A simple widget to show the current brightness of a monitor.

If the change_command parameter is set to None, the widget will attempt to use the interface at /sys/class to change brightness. This depends on having the correct udev rules, so be sure Qtile's udev rules are installed correctly.

You can also bind keyboard shortcuts to the backlight widget with:

from libqtile.widget import backlight
Key(
    [],
    "XF86MonBrightnessUp",
    lazy.widget['backlight'].change_backlight(backlight.ChangeDirection.UP)
)
Key(
    [],
    "XF86MonBrightnessDown",
    lazy.widget['backlight'].change_backlight(backlight.ChangeDirection.DOWN)
)

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Battery

Battery(**config)

Bases: ThreadPoolText

A text-based battery monitoring widget supporting both Linux and FreeBSD.

The Linux version of this widget has functionality to charge "smartly" (i.e. not to 100%) under user defined conditions, and provides some implementations for doing so. For example, to only charge the battery to 90%, use:

Battery(..., charge_controller: lambda (0, 90))

The battery widget also supplies some charging algorithms. To only charge the battery between 40-50% while connected to a thunderbolt docking station, but 90% all other times, use:

from libqtile.widget.battery import thunderbolt_smart_charge
Battery(..., charge_controller: thunderbolt_smart_charge)

To temporarily disable/re-enable this (e.g. if you know you're going mobile and need to charge) use either:

qtile cmd-obj -o bar top widget battery -f charge_to_full
qtile cmd-obj -o bar top widget battery -f charge_dynamically

Or bind a key to:

Key([mod, "shift"], "c", lazy.widget['battery'].charge_to_full())
Key([mod, "shift"], "x", lazy.widget['battery'].charge_dynamically())

Note that this functionality requires qtile to be able to write to certain files in sysfs, so make sure that qtile's udev rules are installed correctly.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • build_string –

    Determine the string to return for the given battery state.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • poll –

    Determine the text to display.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

build_string

build_string(status: BatteryStatus) -> str

Determine the string to return for the given battery state.

Parameters:

  • status (BatteryStatus) –

    The current status of the battery

Returns:

  • str –

    The string to display for the current status.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

poll

poll() -> str

Determine the text to display.

Function returning a string with battery information to display on the status bar. Should only use the public interface in _Battery to get necessary information for constructing the string.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

BatteryIcon

BatteryIcon(**config)

Bases: _Widget

Battery life indicator widget.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw() -> None

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup() -> None

This is called exactly once, after the widget has been configured and timers are available to be set up.

Bluetooth

Bluetooth(**config)

Bases: _TextBox, MarginMixin

Bluetooth widget that provides following functionality: - View multiple adapters/devices (adapters can be filtered) - Set power and discovery status for adapters - Connect/disconnect/pair devices.

The widget works by providing a menu in the bar. Different items are accessed by scrolling up and down on the widget.

Clicking on an adapter will open a submenu allowing you to set power and discovery status.

Clicking on a device will perform an action based on the status of that device: - Connected devices will be disconnected - Disconnected devices will be connected - Unpaired devices (which appear if discovery is on) will be paired and connected

Symbols are used to show the status of adapters and devices.

Battery level for bluetooth devices can also be shown if available. This functionality is not available by default on all distros. If it doesn't work, you can try adding Experimental = true to /etc/bluetooth/main.conf.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • click –

    Perform default action on visible item.

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • format_object –

    Takes the given object and returns a formatted string representing the object.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_proxy –

    Provides proxy object after introspecting the given path.

  • hide –

    Revert widget contents to default.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • scroll_down –

    Scroll down to next item.

  • scroll_up –

    Scroll up to next item.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • show_line –

    Formats the text of the current menu item.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

click

click()

Perform default action on visible item.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

format_object

format_object(obj)

Takes the given object and returns a formatted string representing the object.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_proxy async

get_proxy(path)

Provides proxy object after introspecting the given path.

hide

hide()

Revert widget contents to default.

info

info()

Info for this object.

items

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

scroll_down

scroll_down()

Scroll down to next item.

scroll_up

scroll_up()

Scroll up to next item.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

show_line

show_line()

Formats the text of the current menu item.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CPU

CPU(**config)

Bases: ThreadPoolText

A simple widget to display CPU load and frequency.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CPUGraph

CPUGraph(**config)

Bases: _Graph

Display CPU usage graph.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

Canto

Canto(**config)

Bases: ThreadPoolText

Display RSS feeds updates using the canto console reader.

Widget requirements: canto.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CapsNumLockIndicator

CapsNumLockIndicator(**config)

Bases: ThreadPoolText

Really simple widget to show the current Caps/Num Lock state.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_indicators –

    Return a list with the current state of the keys.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • poll –

    Poll content for the text box.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_indicators

get_indicators()

Return a list with the current state of the keys.

info

info()

Info for this object.

items

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

poll

poll()

Poll content for the text box.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CheckUpdates

CheckUpdates(**config)

Bases: ThreadPoolText

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Chord

Chord(width=CALCULATED, **config)

Bases: _TextBox

Display current key chord.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Clipboard

Clipboard(width=CALCULATED, **config)

Bases: _TextBox

Display current clipboard contents.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Clock

Clock(**config)

Bases: InLoopPollText

A simple but flexible text-based clock.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

  • update_timezone –

    Force the clock to update timezone information.

  • use_system_timezone –

    Force clock to use system timezone.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

update_timezone

update_timezone(timezone: str | tzinfo | None = None)

Force the clock to update timezone information.

If the method is called with no arguments then the widget will reload the timzeone set on the computer (e.g. via timedatectl set-timezone ..). This will have no effect if you have previously set a timezone value.

Alternatively, you can pass a timezone string (e.g. "Europe/Lisbon") to change the specified timezone. Setting this to an empty string will cause the clock to rely on the system timezone.

use_system_timezone

use_system_timezone()

Force clock to use system timezone.

Cmus

Cmus(**config)

Bases: ThreadPoolText

A simple Cmus widget.

Show the metadata of now listening song and allow basic mouse control from the bar:

- toggle pause (or play if stopped) on left click;
- skip forward in playlist on scroll up;
- skip backward in playlist on scroll down.

Cmus (https://cmus.github.io) should be installed.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_info –

    Return a dictionary with info about the current cmus status.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • now_playing –

    Return a string with the now playing info.

  • play –

    Play music if stopped, else toggle pause.

  • poll –

    Poll content for the text box.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_info

get_info()

Return a dictionary with info about the current cmus status.

info

info()

Info for this object.

items

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

now_playing

now_playing()

Return a string with the now playing info.

play

play()

Play music if stopped, else toggle pause.

poll

poll()

Poll content for the text box.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Countdown

Countdown(**config)

Bases: InLoopPollText

A simple countdown timer text widget.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CryptoTicker

CryptoTicker(**config)

Bases: GenPollUrl

A cryptocurrency ticker widget, data provided by the coinbase.com or the binance.com API. Defaults to displaying currency in whatever the current locale is. Examples:

# display the average price of bitcoin in local currency
widget.CryptoTicker()

# display it in Euros:
widget.CryptoTicker(currency="EUR")

# or a different cryptocurrency!
widget.CryptoTicker(crypto="ETH")

# change the currency symbol:
widget.CryptoTicker(currency="EUR", symbol="€")

# display from Binance API
widget.CryptoTicker(api="binance", currency="USDT")

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CurrentLayout

CurrentLayout(width=CALCULATED, **config)

Bases: _TextBox

Display the name of the current layout of the current group of the screen, the bar containing the widget, is on.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CurrentLayoutIcon

CurrentLayoutIcon(**config)

Bases: _TextBox

Display the icon representing the current layout of the current group of the screen on which the bar containing the widget is.

If you are using custom layouts, a default icon with question mark will be displayed for them. If you want to use custom icon for your own layout, for example, FooGrid, then create a file named "layout-foogrid.png" and place it in ~/.icons directory. You can as well use other directories, but then you need to specify those directories in custom_icon_paths argument for this plugin.

The widget will look for icons with a png or svg extension.

The order of icon search is:

  • dirs in custom_icon_paths config argument
  • ~/.icons
  • built-in qtile icons

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

CurrentScreen

CurrentScreen(width=CALCULATED, **config)

Bases: _TextBox

Indicates whether the screen this widget is on is currently active or not.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

DF

DF(**config)

Bases: ThreadPoolText

Disk Free Widget.

By default the widget only displays if the space is less than warn_space.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

DoNotDisturb

DoNotDisturb(**config)

Bases: InLoopPollText

Displays Do Not Disturb status for notification server Dunst by default. Can be used with other servers by changing the poll command and mouse callbacks.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

GenPollCommand

GenPollCommand(**config)

Bases: ThreadPoolText

A generic text widget to display output from scripts or shell commands.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

GenPollText

GenPollText(**config)

Bases: ThreadPoolText

A generic text widget that polls using poll function to get the text.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

GenPollUrl

GenPollUrl(**config)

Bases: ThreadPoolText

A generic text widget that polls an url and parses it using parse function.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

GmailChecker

GmailChecker(**config)

Bases: ThreadPoolText

A simple gmail checker. If 'status_only_unseen' is True - set 'fmt' for one argument, ex. 'unseen: {0}'.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

GroupBox

GroupBox(**config)

Bases: _GroupBase

A widget that graphically displays the current group. All groups are displayed by their label. If the label of a group is the empty string that group will not be displayed.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

Attributes:

  • groups –

    Returns list of visible groups.

groups property

groups

Returns list of visible groups. The existing groups are filtered by the visible_groups attribute and their label. Groups with an empty string as label are never contained. Groups that are not named in visible_groups are not returned.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

HDD

HDD(**config)

Bases: ThreadPoolText

Displays HDD usage in percent based on the number of milliseconds the device has been performing I/O operations.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

HDDBusyGraph

HDDBusyGraph(**config)

Bases: _Graph

Display HDD busy time graph.

Parses /sys/block//stat file and extracts overall device IO usage, based on io_ticks's value. See https://www.kernel.org/doc/Documentation/block/stat.txt

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

HDDGraph

HDDGraph(**config)

Bases: _Graph

Display HDD free or used space graph.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

IdleRPG

IdleRPG(**config)

Bases: GenPollUrl

A widget for monitoring and displaying IdleRPG stats.

# display idlerpg stats for the player 'pants' on freenode's #idlerpg
widget.IdleRPG(url="http://xethron.lolhosting.net/xml.php?player=pants")

Widget requirements: xmltodict.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Image

Image(length=CALCULATED, **config)

Bases: _Widget, MarginMixin

Display a PNG image on the bar.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

ImapWidget

ImapWidget(**config)

Bases: ThreadPoolText

Email IMAP widget.

This widget will scan one of your imap email boxes and report the number of unseen messages present. I've configured it to only work with imap with ssl. Your password is obtained from the Gnome Keyring.

Writing your password to the keyring initially is as simple as (changing out and for your userid and password):

  1. create the file ~/.local/share/python_keyring/keyringrc.cfg with the following contents:

    [backend]
    default-keyring=keyring.backends.Gnome.Keyring
    keyring-path=/home/<userid>/.local/share/keyring/
    
  2. Execute the following python shell script once:

    #!/usr/bin/env python3
    import keyring
    user = <userid>
    password = <password>
    keyring.set_password('imapwidget', user, password)
    

mbox names must include the path to the mbox (except for the default INBOX). So, for example if your mailroot is ~/Maildir, and you want to look at the mailbox at HomeMail/fred, the mbox setting would be: mbox="~/Maildir/HomeMail/fred". Note the nested sets of quotes! Labels can be whatever you choose, of course.

Widget requirements: keyring.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

KeyboardKbdd

KeyboardKbdd(**config)

Bases: ThreadPoolText

Widget for changing keyboard layouts per window, using kbdd.

kbdd should be installed and running, you can get it from: https://github.com/qnikst/kbdd

The widget also requires dbus-next.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

KeyboardLayout

KeyboardLayout(**config)

Bases: InLoopPollText

Widget for changing and displaying the current keyboard layout.

To use this widget effectively you need to specify keyboard layouts you want to use (using "configured_keyboards") and bind function "next_keyboard" to specific keys in order to change layouts.

For example:

Key([mod], "space", lazy.widget["keyboardlayout"].next_keyboard(), desc="Next keyboard layout."),

When running Qtile with the X11 backend, this widget requires setxkbmap to be available. Xmodmap will also be used if .Xmodmap file is available.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • next_keyboard –

    Set the next layout in the list of configured keyboard layouts as

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

next_keyboard

next_keyboard()

Set the next layout in the list of configured keyboard layouts as new current layout in use.

If the current keyboard layout is not in the list, it will set as new layout the first one in the list.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

KhalCalendar

KhalCalendar(**config)

Bases: ThreadPoolText

Khal calendar widget.

This widget will display the next appointment on your Khal calendar in the qtile status bar. Appointments within the "reminder" time will be highlighted.

Widget requirements: dateutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

LaunchBar

LaunchBar(
    _progs: list[tuple[str, str, str]] | None = None,
    width=CALCULATED,
    **config
)

Bases: _Widget

This module defines a widget that displays icons to launch softwares or commands when clicked -- a launchbar. Only png icon files are displayed, not xpm because cairo doesn't support loading of xpm file. The order of displaying (from left to right) is in the order of the list.

If no icon was found for the name provided and if default_icon is set to None then the name is printed instead. If default_icon is defined then this icon is displayed instead.

To execute a software
  • ('thunderbird', 'thunderbird -safe-mode', 'launch thunderbird in safe mode')

To execute a python command in qtile, begin with by 'qshell:' - ('/path/to/icon.png', 'qshell:self.qtile.shutdown()', 'logout from qtile')

Optional requirements: pyxdg for finding the icon path if it is not provided in the progs tuple.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • button_press –

    Launch the associated command to the clicked icon.

  • calculate_length –

    Compute the width of the widget according to each icon width.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Draw the icons in the widget.

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_icon_in_position –

    Determine which icon is clicked according to its position.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • lookup_icons –

    Search for the icons corresponding to the commands to execute.

  • select –

    Return a selected object.

  • setup_images –

    Create image structures for each icon files.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

button_press

button_press(x, y, button)

Launch the associated command to the clicked icon.

calculate_length

calculate_length()

Compute the width of the widget according to each icon width.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Draw the icons in the widget.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_icon_in_position

get_icon_in_position(x, y)

Determine which icon is clicked according to its position.

info

info()

Info for this object.

items

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

lookup_icons

lookup_icons()

Search for the icons corresponding to the commands to execute.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

setup_images

setup_images()

Create image structures for each icon files.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

Load

Load(**config)

Bases: ThreadPoolText

A small widget to show the load averages of the system. Depends on psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Maildir

Maildir(**config)

Bases: ThreadPoolText

A simple widget showing the number of new mails in maildir mailboxes.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • format_text –

    Converts the state of the subfolders to a string.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • poll –

    Scans the mailbox for new messages.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

format_text

format_text(state: dict[str, int]) -> str

Converts the state of the subfolders to a string.

Parameters:

  • state (dict[str, int]) –

    A dictionary mapping subfolder labels to new mail values.

Returns:

  • str –

    A string representation of the given state.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

poll

poll() -> str

Scans the mailbox for new messages.

Returns:

  • str –

    A string representing the current mailbox state.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Memory

Memory(**config)

Bases: ThreadPoolText

Display memory/swap usage.

The following fields are available in the format string:

  • MemUsed: Memory in use.
  • MemTotal: Total amount of memory.
  • MemFree: Amount of memory free.
  • Available: Amount of memory available.
  • NotAvailable: Equal to MemTotal - MemAvailable.
  • MemPercent: Memory in use as a percentage.
  • Buffers: Buffer amount.
  • Active: Active memory.
  • Inactive: Inactive memory.
  • Shmem: Shared memory.
  • SwapTotal: Total amount of swap.
  • SwapFree: Amount of swap free.
  • SwapUsed: Amount of swap in use.
  • SwapPercent: Swap in use as a percentage.
  • mm: Measure unit for memory.
  • ms: Measure unit for swap.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

MemoryGraph

MemoryGraph(**config)

Bases: _Graph

Displays a memory usage graph.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

Mirror

Mirror(reflection, **config)

Bases: _Widget

A widget for showing the same widget content in more than one place, for instance, on bars across multiple screens.

You don't need to use it directly; instead, just instantiate your widget once and hand it in to multiple bars. For instance:

cpu = widget.CPUGraph()
clock = widget.Clock()

screens = [
    Screen(top=bar.Bar([widget.GroupBox(), cpu, clock])),
    Screen(top=bar.Bar([widget.GroupBox(), cpu, clock])),
]

Widgets can be passed to more than one bar, so that there don't need to be any duplicates executing the same code all the time, and they'll always be visually identical.

This works for all widgets that use drawers (and nothing else) to display their contents. Currently, this is all widgets except for Systray.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

Moc

Moc(**config)

Bases: ThreadPoolText

A simple MOC widget.

Show the artist and album of now listening song and allow basic mouse control from the bar:

  • toggle pause (or play if stopped) on left click;
  • skip forward in playlist on scroll up;
  • skip backward in playlist on scroll down.

MOC (http://moc.daper.net) should be installed.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_info –

    Return a dictionary with info about the current MOC status.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • now_playing –

    Return a string with the now playing info (Artist - Song Title).

  • play –

    Play music if stopped, else toggle pause.

  • poll –

    Poll content for the text box.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_info

get_info()

Return a dictionary with info about the current MOC status.

info

info()

Info for this object.

items

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

now_playing

now_playing()

Return a string with the now playing info (Artist - Song Title).

play

play()

Play music if stopped, else toggle pause.

poll

poll()

Poll content for the text box.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Mpd2

Mpd2(**config)

Bases: ThreadPoolText

Mpd2 Object.

Widget requirements: python-mpd2.

Parameters:

  • **config –

    See other parameters.

Other Parameters:

  • status_format –

    Format string to display status.

    For a full list of values, see: MPDClient.status() and MPDClient.currentsong().

    Default:

    '{play_status} {artist}/{title} \
        [{repeat}{random}{single}{consume}{updating_db}]'
    

    play_status is a string from play_states dict.

    Note that the time property of the song renamed to fulltime to prevent conflicts with status information during formating.

  • idle_format –

    Format string to display status when no song is in queue.

    Default:

    '{play_status} {idle_message} \
        [{repeat}{random}{single}{consume}{updating_db}]'
    

    Note that the artist key fallbacks to similar keys in specific order (artist -> albumartist -> performer -> -> composer -> conductor -> ensemble).

  • idle_message –

    Text to display instead of song information when MPD is idle (i.e. no song in queue).

    Default: "MPD IDLE".

  • undefined_value –

    Text to display when status key is undefined.

    Default: "Undefined".

  • prepare_status –

    Dict of functions to replace values in status with custom characters.

    f(status, key, space_element) => str
    

    New functionality allows use of a dictionary of plain strings.

    Default:

    status_dict = {
        'repeat': 'r',
        'random': 'z',
        'single': '1',
        'consume': 'c',
        'updating_db': 'U'
    }
    
  • format_fns –

    A dict of functions to format the various elements.

    'Tag': f(str) => str

    Default: {'all': lambda s: cgi.escape(s)}

    N.B.: if 'all' is present, it is processed on every element of song_info before any other formatting is done.

  • mouse_buttons –

    A dict of mouse button numbers to actions.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • button_press –

    Handle click event on widget.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • finalize –

    Finalize.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • formatter –

    Format song info.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • poll –

    Called by qtile manager.

  • prepare_formatting –

    Old way of preparing status formatting.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • toggle –

    Toggle play/pause.

  • update –

    Update the widget text.

  • update_status –

    Get updated info from mpd server and call format.

Attributes:

  • connected –

    Attempt connection to mpd server.

connected property

connected

Attempt connection to mpd server.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

button_press

button_press(x, y, button)

Handle click event on widget.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

finalize

finalize()

Finalize.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

formatter

formatter(status, current_song)

Format song info.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

poll

poll()

Called by qtile manager.

Poll the mpd server and update widget.

prepare_formatting

prepare_formatting(status)

Old way of preparing status formatting.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

toggle

toggle()

Toggle play/pause.

update

update(text)

Update the widget text.

update_status

update_status()

Get updated info from mpd server and call format.

Mpris2

Mpris2(**config)

Bases: _TextBox

An MPRIS 2 widget.

A widget which displays the current track/artist of your favorite MPRIS player. This widget scrolls the text if neccessary and information that is displayed is configurable.

The widget relies on players broadcasting signals when the metadata or playback status changes. If you are getting inconsistent results then you can enable background polling of the player by setting the poll_interval parameter. This is disabled by default.

Basic mouse controls are also available: button 1 = play/pause, scroll up = next track, scroll down = previous track.

Widget requirements: dbus-next.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    What's the current state of the widget?

  • items –

    Build a list of contained items for the given item class.

  • next –

    Play the next track.

  • parse_message –
  • play_pause –

    Toggle the playback status.

  • previous –

    Play the previous track.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • stop –

    Stop playback.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

What's the current state of the widget?

items

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

next

next() -> None

Play the next track.

parse_message

parse_message(
    _interface_name: str,
    changed_properties: dict[str, Any],
    _invalidated_properties: list[str],
) -> None

play_pause

play_pause() -> None

Toggle the playback status.

previous

previous() -> None

Play the previous track.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

stop

stop() -> None

Stop playback.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Net

Net(**config)

Bases: ThreadPoolText

Displays interface down and up speed.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • convert_b –

    Converts the number of bytes to the correct unit.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

convert_b

convert_b(num_bytes: float) -> tuple[float, str]

Converts the number of bytes to the correct unit.

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

NetGraph

NetGraph(**config)

Bases: _Graph

Display a network usage graph.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

Notify

Notify(width=CALCULATED, **config)

Bases: _TextBox

A notify widget.

This widget can handle actions provided by notification clients. However, only the default action is supported, so if a client provides multiple actions then only the default (first) action can be invoked. Some programs will provide their own notification windows if the notification server does not support actions, so if you want your notifications to handle more than one action then specify False for the action option to disable all action handling. Unfortunately we cannot specify the capability for exactly one action.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • clear –

    Clear the notification.

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • invoke –

    Invoke the notification's default action.

  • items –

    Build a list of contained items for the given item class.

  • prev –

    Show previous notification.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • toggle –

    Toggle showing/clearing the notification.

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

clear

clear(reason=dismissed)

Clear the notification.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

invoke

invoke()

Invoke the notification's default action.

items

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

prev

prev()

Show previous notification.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

toggle

toggle()

Toggle showing/clearing the notification.

update

update(notif)

Update the widget text.

NvidiaSensors

NvidiaSensors(**config)

Bases: ThreadPoolText

Displays temperature, fan speed and performance level Nvidia GPU.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

OpenWeather

OpenWeather(**config)

Bases: GenPollUrl

A weather widget, data provided by the OpenWeather API.

Some format options
  • location_city
  • location_cityid
  • location_country
  • location_lat
  • location_long

  • weather

  • weather_details
  • units_temperature
  • units_wind_speed
  • isotime
  • humidity
  • pressure
  • sunrise
  • sunset
  • temp
  • visibility
  • wind_speed
  • wind_deg
  • wind_direction

  • main_feels_like

  • main_temp_min
  • main_temp_max
  • clouds_all
  • icon

Icon support is available but you will need a suitable font installed. A default icon mapping is provided (OpenWeather.symbols) but changes can be made by setting weather_symbols. Available icon codes can be viewed here: https://openweathermap.org/weather-conditions#Icon-list

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Pomodoro

Pomodoro(**config)

Bases: ThreadPoolText

Pomodoro technique widget.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Prompt

Prompt(**config)

Bases: _TextBox

A widget that prompts for user input.

Input should be started using the .start_input() method on this class.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • exec_general –

    Execute a cmd of any object.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Returns a dictionary of info for this object.

  • items –

    Build a list of contained items for the given item class.

  • process_key_press –

    Key press handler for the minibuffer.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • start_input –

    Run the prompt.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length() -> int

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

exec_general

exec_general(
    prompt: str,
    object_name: str,
    cmd_name: str,
    selector=None,
    completer=None,
)

Execute a cmd of any object.

For example layout, group, window, widget, etc., with a string that is obtained from start_input.

Parameters:

  • prompt (str) –

    Text displayed at the prompt.

  • object_name (str) –

    Name of a object in Qtile. This string has to be 'layout', 'widget', 'bar', 'window' or 'screen'.

  • cmd_name (str) –

    Execution command of selected object using object_name and selector.

  • selector –

    This value select a specific object within a object list that is obtained by object_name. If this value is None, current object is selected. e.g. current layout, current window and current screen.

  • completer –

    Completer to use.

Config example:

Key([alt, 'shift'], 'a',
    lazy.widget['prompt'].exec_general(
        'section(add)',
        'layout',
        'add_section'))

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Returns a dictionary of info for this object.

items

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

process_key_press

process_key_press(keysym: int)

Key press handler for the minibuffer.

Currently only supports ASCII characters.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

start_input

start_input(
    prompt: str,
    callback: Callable,
    complete: str | None = None,
    strict_completer: bool = False,
    allow_empty_input: bool = False,
    aliases: dict[str, str] | None = None,
) -> None

Run the prompt.

Displays a prompt and starts to take one line of keyboard input from the user. When done, calls the callback with the input string as argument. If history record is enabled, also allows to browse between previous commands with ↑ and ↓, and execute them (untouched or modified). When history is exhausted, fires an alert. It tries to mimic, in some way, the shell behavior.

Parameters:

  • prompt (str) –

    Text displayed at the prompt, e.g. "spawn: ".

  • callback (Callable) –

    Function to call with returned value.

  • complete (str | None, default: None ) –

    Tab-completion. Can be None, "cmd", "file", "group", "qshell" or "window".

  • strict_completer (bool, default: False ) –

    When True the return value wil be the exact completer result where available.

  • allow_empty_input (bool, default: False ) –

    When True, an empty value will still call the callback function.

  • aliases (dict[str, str] | None, default: None ) –

    Dictionary mapping aliases to commands. If the entered command is a key in this dict, the command it maps to will be executed instead.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

PulseVolume

PulseVolume(**config)

Bases: Volume

Volume widget for systems using PulseAudio.

The widget connects to the PulseAudio server by using the libpulse library and so should be updated virtually instantly rather than needing to poll the volume status regularly (NB this means that the update_interval parameter serves no purpose for this widget).

The widget relies on the pulsectl_asyncio_ library to access the libpulse bindings. If you are using python 3.11 you must use pulsectl_asyncio >= 1.0.0.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • decrease_vol –

    Decrease volume.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • increase_vol –

    Increase volume.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • mute –

    Mute the sound device.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Same method as in Volume widgets except that here we don't need to

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

decrease_vol

decrease_vol(value=None)

Decrease volume.

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

increase_vol

increase_vol(value=None)

Increase volume.

info

info()

Info for this object.

items

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

mute

mute()

Mute the sound device.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update()

Same method as in Volume widgets except that here we don't need to manually re-schedule update.

QuickExit

QuickExit(**config)

Bases: _TextBox

A button to shut down Qtile. When clicked, a countdown starts. Clicking the button again stops the countdown and prevents Qtile from shutting down.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update()

Update the widget text.

ScreenSplit

ScreenSplit(**config)

Bases: TextBox

A simple widget to show the name of the current split and layout for the ScreenSplit layout.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Retrieve the text in a TextBox widget.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get()

Retrieve the text in a TextBox widget.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Sep

Sep(**config)

Bases: _Widget

A visible widget separator.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

She

She(**config)

Bases: InLoopPollText

Widget to display the Super Hybrid Engine status.

Can display either the mode or CPU speed on eeepc computers.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Spacer

Spacer(length: int = STRETCH, **config)

Bases: _Widget

Just an empty space on the bar.

Often used with length equal to bar.STRETCH to push bar widgets to the right or bottom edge of the screen.

Parameters:

  • length (int, default: STRETCH ) –

    Length of the widget. Can be either bar.STRETCH or a length in pixels.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

StatusNotifier

StatusNotifier(**config)

Bases: _Widget

A 'system tray' widget using the freedesktop StatusNotifierItem specification.

As per the specification, app icons are first retrieved from the user's current theme. If this is not available then the app may provide its own icon. In order to use this functionality, users are recommended to install the pyxdg module to support retrieving icons from the selected theme. If the icon specified by StatusNotifierItem can not be found in the user's current theme and no other icons are provided by the app, a fallback icon is used.

Left-clicking an icon will trigger an activate event.

Note: Context menus are not currently supported by the official widget. However, a modded version of the widget which provides basic menu support is available from elParaguayo's qtile-extras repo.

Methods:

  • activate –

    Primary action when clicking on an icon.

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • find_icon_at_pos –

    Returns StatusNotifierItem object for icon in given position.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

activate

activate()

Primary action when clicking on an icon.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

find_icon_at_pos

find_icon_at_pos(x, y)

Returns StatusNotifierItem object for icon in given position.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

StockTicker

StockTicker(**config)

Bases: GenPollUrl

A stock ticker widget, based on the alphavantage API. Users must acquire an API key from https://www.alphavantage.co/support/#api-key.

The widget defaults to the TIME_SERIES_INTRADAY API function (i.e. stock symbols), but arbitrary Alpha Vantage API queries can be made by passing extra arguments to the constructor.

# Display AMZN
widget.StockTicker(apikey=..., symbol="AMZN")

# Display BTC
widget.StockTicker(
    apikey=..., function="DIGITAL_CURRENCY_INTRADAY", symbol="BTC", market="USD"
)

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

SwapGraph

SwapGraph(**config)

Bases: _Graph

Display a swap info graph.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

Systray

Systray(**config)

Bases: _Widget, _Window

A widget that manages system tray.

Only one Systray widget is allowed. Adding additional Systray widgets will result in a ConfigError.

Note

Icons will not render correctly where the bar/widget is drawn with a semi-transparent background. Instead, icons will be drawn with a transparent background.

If using this widget it is therefore recommended to use a fully opaque background colour or a fully transparent one.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • change_layer –

    Raise a window above its peers or move it below them, depending on 'up'.

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • create_mirror –

    Systray cannot be mirrored as we do not use a Drawer object to render icons.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • focus –

    Focuses the window.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_hints –

    Returns the X11 hints (WM_HINTS and WM_SIZE_HINTS) for this window.

  • get_layering_information –

    Get layer-related EMWH-flags.

  • info –

    Info for this object.

  • inspect –

    Tells you more than you ever wanted to know about a window.

  • is_transient_for –

    What window is this window a transient windor for?

  • items –

    Build a list of contained items for the given item class.

  • place –

    Places the window at the specified location with the given size.

  • raise_children –

    Ensure any transient windows are moved up with the parent.

  • select –

    Return a selected object.

  • send_configure_notify –

    Send a synthetic ConfigureNotify.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update_hints –

    Update the local copy of the window's WM_HINTS.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

change_layer

change_layer(up=True, top_bottom=False)

Raise a window above its peers or move it below them, depending on 'up'. Raising a normal window will not lift it above pinned windows etc.

There are a few important things to take note of when relaying windows: 1. If a window has a defined parent, it should not be moved underneath it. In case children are blocking, this could leave an application in an unusable state. 2. If a window has children, they should be moved along with it. 3. If a window has a defined parent, either move the parent or do nothing at all. 4. EMWH-flags follow strict layering rules: https://specifications.freedesktop.org/wm-spec/1.3/ar01s07.html#STACKINGORDER

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

create_mirror

create_mirror()

Systray cannot be mirrored as we do not use a Drawer object to render icons.

Return new, unconfigured instance so that, when the bar tries to configure it again, a ConfigError is raised.

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

focus

focus(warp: bool = True) -> None

Focuses the window.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_hints

get_hints()

Returns the X11 hints (WM_HINTS and WM_SIZE_HINTS) for this window.

get_layering_information

get_layering_information() -> (
    tuple[bool, bool, bool, bool, bool, bool]
)

Get layer-related EMWH-flags.

See https://specifications.freedesktop.org/wm-spec/1.3/ar01s07.html#STACKINGORDER.

Copied here:

To obtain good interoperability between different Desktop Environments, the following layered stacking order is recommended, from the bottom:

  • windows of type _NET_WM_TYPE_DESKTOP
  • windows having state _NET_WM_STATE_BELOW
  • windows not belonging in any other layer
  • windows of type _NET_WM_TYPE_DOCK (unless they have state _NET_WM_TYPE_BELOW) and windows having state _NET_WM_STATE_ABOVE
  • focused windows having state _NET_WM_STATE_FULLSCREEN

Windows that are transient for another window should be kept above this window.

The window manager may choose to put some windows in different stacking positions, for example to allow the user to bring currently a active window to the top and return it back when the window loses focus. To this end, qtile adds an additional layer so that scratchpad windows are placed above all others, always.

info

info()

Info for this object.

inspect

inspect()

Tells you more than you ever wanted to know about a window.

is_transient_for

is_transient_for()

What window is this window a transient windor for?

items

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

place

place(
    x: int,
    y: int,
    width: int,
    height: int,
    borderwidth: int,
    bordercolor: str,
    above: bool = False,
    margin: int | list[int] | None = None,
    respect_hints: bool = False,
)

Places the window at the specified location with the given size.

Parameters:

  • x (int) –

    Integer.

  • y (int) –

    Integer.

  • width (int) –

    Integer.

  • height (int) –

    Integer.

  • borderwidth (int) –

    Integer.

  • bordercolor (str) –

    String.

  • above (bool, default: False ) –

    Boolean, optional.

  • margin (int | list[int] | None, default: None ) –

    Integer or list, optional. Space around window as int or list of ints [N E S W].

  • above (bool, default: False ) –

    Bool, optional. If True, the geometry will be adjusted to respect hints provided by the client.

raise_children

raise_children(stack=None)

Ensure any transient windows are moved up with the parent.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

send_configure_notify

send_configure_notify(x, y, width, height)

Send a synthetic ConfigureNotify.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update_hints

update_hints()

Update the local copy of the window's WM_HINTS.

See http://tronche.com/gui/x/icccm/sec-4.html#WM_HINTS

TaskList

TaskList(**config)

Bases: _Widget, PaddingMixin, MarginMixin

Displays the icon and name of each window in the current group.

Contrary to WindowTabs this is an interactive widget. The window that currently has focus is highlighted.

Optional requirements: pyxdg_ is needed to use theme icons and to display icons on Wayland.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • box_width –

    Calculate box width for given text.

  • calc_box_widths –

    Calculate box width for each window in current group.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_taskname –

    Get display name for given window.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

box_width

box_width(text)

Calculate box width for given text. If max_title_width is given, the returned width is limited to it.

calc_box_widths

calc_box_widths()

Calculate box width for each window in current group. If the available space is less than overall size of boxes, the boxes are shrunk by percentage if greater than average.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_taskname

get_taskname(window)

Get display name for given window. Depending on its state minimized, maximized and floating appropriate characters are prepended.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

TextBox

TextBox(text=' ', width=CALCULATED, **config)

Bases: _TextBox

A flexible textbox that can be updated from bound keys, scripts, and qshell.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Retrieve the text in a TextBox widget.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get()

Retrieve the text in a TextBox widget.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

ThermalSensor

ThermalSensor(**config)

Bases: InLoopPollText

Widget to display temperature sensor information.

For using the thermal sensor widget you need to have lm-sensors installed. You can get a list of the tag_sensors executing "sensors" in your terminal. Then you can choose which you want, otherwise it will display the first available.

Widget requirements: psutil.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • get_temp_sensors –

    Reads temperatures from sys-fs via psutil.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

get_temp_sensors

get_temp_sensors()

Reads temperatures from sys-fs via psutil. Output will be read Fahrenheit if user has specified it to be.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

ThermalZone

ThermalZone(**config)

Bases: ThreadPoolText

Thermal zone widget.

This widget was made to read thermal zone files and transform values to human readable format. You can set zone parameter to any standard thermal zone file from /sys/class/thermal directory.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Volume

Volume(**config)

Bases: _TextBox

Widget that display and change volume.

By default, this widget uses amixer to get and set the volume so users will need to make sure this is installed. Alternatively, users may set the relevant parameters for the widget to use a different application.

If theme_path is set it draw widget as icons.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update()

Update the widget text.

Wallpaper

Wallpaper(**config)

Bases: _TextBox

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

WidgetBox

WidgetBox(_widgets: list[_Widget] | None = None, **config)

Bases: _TextBox

A widget to declutter your bar.

WidgetBox is a widget that hides widgets by default but shows them when the box is opened.

Widgets that are hidden will still update etc. as if they were on the main bar.

Button clicks are passed to widgets when they are visible so callbacks will work.

Widgets in the box also remain accessible via command interfaces.

Widgets can only be added to the box via the configuration file. The widget is configured by adding widgets to the "widgets" parameter as follows:

widget.WidgetBox(widgets=[
    widget.TextBox(text="This widget is in the box"),
    widget.Memory()
    ]
),

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • close –

    Close the widgetbox.

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • open –

    Open the widgetbox.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • toggle –

    Toggle box state.

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

close

close()

Close the widgetbox.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

open

open()

Open the widgetbox.

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

toggle

toggle()

Toggle box state.

update

update(text)

Update the widget text.

WindowCount

WindowCount(width=CALCULATED, **config)

Bases: _TextBox

A simple widget to display the number of windows in the current group of the screen on which the widget is.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Retrieve the current text.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get()

Retrieve the current text.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

WindowName

WindowName(width=STRETCH, **config)

Bases: _TextBox

Displays the name of the window that currently has focus.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

WindowTabs

WindowTabs(**config)

Bases: _TextBox

Displays the name of each window in the current group. Contrary to TaskList this is not an interactive widget. The window that currently has focus is highlighted.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(*args)

Update the widget text.

Wlan

Wlan(**config)

Bases: InLoopPollText

Displays Wifi SSID and quality.

Widget requirements: iwlib.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.

Wttr

Wttr(**config)

Bases: GenPollUrl

Display weather widget provided by wttr.in.

To specify your own custom output format, use the special %-notation (example: 'My_city: %t(%f), wind: %w'):

  • %c Weather condition,
  • %C Weather condition textual name,
  • %h Humidity,
  • %t Temperature (Actual),
  • %f Temperature (Feels Like),
  • %w Wind,
  • %l Location,
  • %m Moonphase 🌑🌒🌓🌔🌕🌖🌗🌘,
  • %M Moonday,
  • %p precipitation (mm),
  • %P pressure (hPa),
  • %D Dawn !,
  • %S Sunrise !,
  • %z Zenith !,
  • %s Sunset !,
  • %d Dusk !. (!times are shown in the local timezone)

Add the character ~ at the beginning to get weather for some special location: ~Vostok Station or ~Eiffel Tower.

Also can use IP-addresses (direct) or domain names (prefixed with @) to specify a location: @github.com, 123.456.678.123

Specify multiple locations as dictionary:

location={
    'Minsk': 'Minsk',
    '64.127146,-21.873472': 'Reykjavik',
}

Cities will change randomly every update.

Methods:

  • add_callbacks –

    Add default callbacks with a lower priority than user-specified callbacks.

  • add_defaults –

    Add defaults to this object, overwriting any which already exist.

  • calculate_length –

    Must be implemented if the widget can take CALCULATED for length.

  • call_process –

    This method uses subprocess.check_output to run the given command

  • check_width –

    Check whether the widget needs to have calculated or fixed width

  • command –

    Return the command with the given name.

  • commands –

    Returns a list of possible commands for this object.

  • doc –

    Returns the documentation for a specified command name.

  • draw –

    Method that draws the widget. You may call this explicitly to

  • eval –

    Evaluates code in the same context as this function.

  • force_update –

    Immediately poll the widget. Existing timers are unaffected.

  • function –

    Call a function with current object as argument.

  • get –

    Utility function for quick retrieval of a widget by name.

  • info –

    Info for this object.

  • items –

    Build a list of contained items for the given item class.

  • select –

    Return a selected object.

  • set_font –

    Change the font used by this widget. If font is None, the current

  • timeout_add –

    This method calls .call_later with given arguments.

  • timer_setup –

    This is called exactly once, after the widget has been configured

  • update –

    Update the widget text.

add_callbacks

add_callbacks(defaults)

Add default callbacks with a lower priority than user-specified callbacks.

add_defaults

add_defaults(defaults)

Add defaults to this object, overwriting any which already exist.

calculate_length

calculate_length()

Must be implemented if the widget can take CALCULATED for length. It must return the width of the widget if it's installed in a horizontal bar; it must return the height of the widget if it's installed in a vertical bar. Usually you will test the orientation of the bar with 'self.bar.horizontal'.

call_process

call_process(command, **kwargs)

This method uses subprocess.check_output to run the given command and return the string from stdout, which is decoded when using Python 3.

check_width

check_width()

Check whether the widget needs to have calculated or fixed width and whether the text should be scrolled.

command

command(name: str) -> Callable | None

Return the command with the given name.

Parameters:

  • name (str) –

    The name of the command to fetch.

commands

commands() -> list[str]

Returns a list of possible commands for this object.

Used by qsh for command completion and online help

doc

doc(name) -> str

Returns the documentation for a specified command name.

Used by qsh to provide online help.

draw

draw()

Method that draws the widget. You may call this explicitly to redraw the widget, but only if the length of the widget hasn't changed. If it has, you must call bar.draw instead.

eval

eval(code: str) -> tuple[bool, str | None]

Evaluates code in the same context as this function.

Return value is tuple (success, result), success being a boolean and result being a string representing the return value of eval, or None if exec was used instead.

force_update

force_update()

Immediately poll the widget. Existing timers are unaffected.

function

function(function, *args, **kwargs) -> None

Call a function with current object as argument.

get

get(q, name)

Utility function for quick retrieval of a widget by name.

info

info()

Info for this object.

items

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

select

select(selectors: list[SelectorType]) -> CommandObject

Return a selected object.

Recursively finds an object specified by a list of (name, selector) items.

Raises SelectError if the object does not exist.

set_font

set_font(
    font: Union[str, None] = None,
    fontsize: int = 0,
    fontshadow: ColorType = "",
)

Change the font used by this widget. If font is None, the current font is used.

timeout_add

timeout_add(seconds, method, method_args=())

This method calls .call_later with given arguments.

timer_setup

timer_setup()

This is called exactly once, after the widget has been configured and timers are available to be set up.

update

update(text)

Update the widget text.