The screens configuration variable is where the physical screens, their associated bars, and the widgets contained within the bars are defined.
A physical screen, and its associated paraphernalia.
class Screen:
def __init__(self, top=None, bottom=None, left=None, right=None):
...
Note that bar.Bar objects can only be placed at the top or the bottom of the screen (bar.Gap objects can be placed anywhere).
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| info() | Returns a dictionary of info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
| resize(x=None, y=None, w=None, h=None) | Resize the screen. |
A bar, which can contain widgets. Note that bars can only be placed at the top or bottom of the screen.
class Bar:
def __init__(self, widgets, size, **config):
...
| config | default | description |
|---|---|---|
| background | '#000000' | Background colour. |
| opacity | 1 | Bar window opacity. |
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| fake_click(screen, position, x, y) | Fake a mouse-click on the bar. Co-ordinates are relative to the top-left corner of the bar. :screen The integer screen offset :position One of "top", "bottom", "left", or "right" |
| info() | Info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
A gap, placed along one of the edges of the screen. If a gap has been defined, Qtile will avoid covering it with windows. The most probable reason for configuring a gap is to make space for a third-party bar or other static window.
class Gap:
def __init__(self, size):
...
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| info() | Info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
A simple but flexible text-based clock.
class Clock:
def __init__(self, fmt='%H:%M', width=CALCULATED, **config):
...
fmt: A Python datetime format string.
width: A fixed width, or bar.CALCULATED to calculate the width automatically (which is recommended).
| config | default | description |
|---|---|---|
| font | 'Monospace' | Clock font |
| fontsize | None | Clock pixel size. Calculated if None. |
| padding | None | Clock padding. Calculated if None. |
| background | '000000' | Background colour |
| foreground | 'ffffff' | Foreground colour |
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| info() | Info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
A widget that graphically displays the group list, indicating which groups have focus, and which groups contain clients.
class GroupBox:
def __init__(self, **config):
...
| config | default | description |
|---|---|---|
| padding_y | 2 | Y padding outside the box |
| padding_x | 2 | X padding outside the box |
| borderwidth | 3 | Current group border width. |
| font | 'Monospace' | Font face |
| active | 'FFFFFF' | Active group font colour |
| inactive | '404040' | Inactive group font colour |
| background | '000000' | Widget background |
| this_screen_border | '215578' | Border colour for group on this screen. |
| other_screen_border | '404040' | Border colour for group on other screen. |
| min_margin_x | 5 | Minimum X margin (inside the box). |
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| info() | Info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
Just an empty space on the bar. Often used with width equal to bar.STRETCH to push bar widgets to the right edge of the screen.
class Spacer:
def __init__(self, width=STRETCH):
...
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| info() | Info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
A flexible textbox that can be updated from bound keys, scripts and qsh.
class TextBox:
def __init__(self, name, text=' ', width=CALCULATED, **config):
...
| config | default | description |
|---|---|---|
| font | 'Monospace' | Text font |
| fontsize | None | Font pixel size. Calculated if None. |
| padding | None | Padding left and right. Calculated if None. |
| background | None | Background colour. |
| foreground | '#ffffff' | Foreground colour. |
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| get() | Retrieve the text in a TextBox widget. |
| info() | Info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
| update(text) | Update the text in a TextBox widget. |
Displays the name of the window that currently has focus.
class WindowName:
def __init__(self, **config):
...
| config | default | description |
|---|---|---|
| font | 'Monospace' | Font face. |
| fontsize | None | Font pixel size. Calculated if None. |
| padding | None | Padding left and right. |
| background | '000000' | Background colour. |
| foreground | 'ffffff' | Foreground colour. |
| command | description |
|---|---|
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| info() | Info for this object. |
| items(name) | Returns a list of contained items for the specified name. Used by qsh to allow navigation of the object graph. |
Tying together screens, bars and widgets, we get something like this:
from libqtile.manager import Screen
from libqtile import bar, widget
screens = [
Screen(
bottom = bar.Bar(
[
widget.GroupBox(),
widget.WindowName()
],
30,
),
),
Screen(
bottom = bar.Bar(
[
widget.GroupBox(),
widget.WindowName()
],
30,
),
)
]
Copyright (c) 2010 Aldo Cortesi