Bar objects¶
The bar is primarily used to display widgets on the screen. As a result, the bar does not need many of its own commands.
To select a bar on the command graph, you must use a selector (as there is no default bar). The selector is the position of the bar on the screen i.e. "top", "bottom", "left" or "right".
The bar can access the screen it's on and the widgets it contains via the command graph.
.. qtile_graph:: :root: bar
bar
¶
Classes:
Bar
¶
Bases: Gap
, Configurable
, CommandObject
A bar, which can contain widgets.
Parameters:
-
widgets
(list[_Widget]
) –A list of widget objects.
-
size
(int
) –The "thickness" of the bar, i.e. the height of a horizontal bar, or the width of a vertical bar.
Methods:
-
add_defaults
–Add defaults to this object, overwriting any which already exist.
-
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.
-
eval
–Evaluates code in the same context as this function.
-
fake_button_press
–Fake a mouse-button-press on the bar.
-
function
–Call a function with current object as argument.
-
info
–Info for this object.
-
items
–Build a list of contained items for the given item class.
-
kill_window
–Kill the window when the bar's screen is no longer being used.
-
select
–Return a selected object.
-
widget_grab_keyboard
–A widget can call this method to grab the keyboard focus and receive keyboard messages.
-
widget_ungrab_keyboard
–Removes keyboard focus from the widget.
add_defaults
¶
add_defaults(defaults)
Add defaults to this object, overwriting any which already exist.
command
¶
commands
¶
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.
eval
¶
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.
fake_button_press
¶
Fake a mouse-button-press on the bar.
Coordinates are relative to the top-left corner of the bar.
function
¶
function(function, *args, **kwargs) -> None
Call a function with current object as argument.
items
¶
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.
widget_grab_keyboard
¶
widget_grab_keyboard(widget: _Widget) -> None
A widget can call this method to grab the keyboard focus and receive keyboard messages.
When done, widget_ungrab_keyboard()
must be called.