A group is a container for a bunch of windows, analogous to workspaces in other
window managers. Each client window managed by the window manager belongs to
exactly one group. The groups config file variable should be initialized to
a list of libqtile.config.Group objects.
libqtile.config.Group objects provide several options for group
configuration. Groups can be configured to show and hide themselves when
they're not empty, spawn applications for them when they start, automatically
acquire certain groups, and various other options.
fromlibqtile.configimportGroup,Matchgroups=[Group("a"),Group("b"),Group("c",matches=[Match(wm_class=["Firefox"])]),]# allow mod3+1 through mod3+0 to bind to groups; if you bind your groups# by hand in your config, you don't need to do this.fromlibqtile.dgroupsimportsimple_key_binderdgroups_key_binder=simple_key_binder("mod3")
The name of default layout for this group (e.g. "max"). This is the name
specified for a particular layout in config.py or if not defined it defaults
in general to the class name in all lower case.
Window properties to compare (match) with a window.
The properties will be compared to a [libqtile.base.Window][libqtile.base.Window] to determine if
its properties match. It can match by title, wm_class, role, wm_type,
wm_instance_class, net_wm_pid, or wid. Additionally, a function may be
passed, which takes in the [libqtile.base.Window][libqtile.base.Window] to be compared
against and returns a boolean.
For some properties, [Match][Match] supports both regular expression objects (i.e.
the result of re.compile()) or strings (match as an exact string). If a
window matches all specified values, it is considered a match.
libqtile.config.ScratchPad is a special - by default invisible -
group which acts as a container for libqtile.config.DropDown
configurations. A libqtile.config.DropDown can be configured to spawn
a defined process and bind thats process' window to it. The associated window
can then be shown and hidden by the lazy command [dropdown_toggle][dropdown_toggle] (see
lazy objects) from the ScratchPad group. Thus - for example - your favorite
terminal emulator turns into a quake-like terminal by the control of Qtile.
If the DropDown window turns visible it is placed as a floating window on top
of the current group. If the DropDown is hidden, it is simply switched back to
the ScratchPad group.
fromlibqtile.configimportGroup,ScratchPad,DropDown,Keyfromlibqtile.lazyimportlazygroups=[ScratchPad("scratchpad",[# define a drop down terminal.# it is placed in the upper third of screen by default.DropDown("term","urxvt",opacity=0.8),# define another terminal exclusively for `qtile shell` at different positionDropDown("qtile shell","urxvt -hold -e 'qtile shell'",x=0.05,y=0.4,width=0.9,height=0.6,opacity=0.9,on_focus_lost_hide=True)]),Group("a"),]keys=[# toggle visibiliy of above defined DropDown named "term"Key([],'F11',lazy.group['scratchpad'].dropdown_toggle('term')),Key([],'F12',lazy.group['scratchpad'].dropdown_toggle('qtile shell')),]
Note that if the window is set to not floating, it is detached from DropDown
and ScratchPad, and a new process is spawned next time the DropDown is set
visible.
Some programs run in a server-like mode where the spawned process does not
directly own the window that is created, which is instead created by a
background process. In this case, the window may not be correctly caught in the
scratchpad group. To work around this, you can pass a
libqtile.config.Match object to the corresponding
libqtile.config.DropDown. See below.
ScratchPad adds a (by default) invisible group to Qtile. That group is used as a
place for currently not visible windows spawned by a [DropDown][DropDown]
configuration.