A layout is an algorithm for laying out windows in a group on your screen. Since Qtile is a tiling window manager, this usually means that we try to use space as efficiently as possible, and give the user ample commands that can be bound to keys to interact with layouts.
The layouts variable defines the list of layouts you will use with Qtile. The first layout in the list is the default. If you define more than one layout, you will probably also want to define key bindings to let you switch to the next and previous layouts.
The stack layout divides the screen horizontally into a set of stacks. Commands allow you to switch between stacks, to next and previous windows within a stack, and to split a stack to show all windows in the stack, or unsplit it to show only the current window. At the moment, this is the most mature and flexible layout in Qtile.
class Stack:
def __init__(self, stacks=2, **config):
...
| config | default | description |
|---|---|---|
| border_focus | '#0000ff' | Border colour for the focused window. |
| border_normal | '#000000' | Border colour for un-focused winows. |
| border_width | 1 | Border width. |
| command | description |
|---|---|
| add() | Add another stack to the layout. |
| client_to_next() | Send the current client to the next stack. |
| client_to_previous() | Send the current client to the previous stack. |
| client_to_stack(n) | Send the current client to stack n, where n is an integer offset. If is too large or less than 0, it is wrapped modulo the number of stacks. |
| commands() | Returns a list of possible commands for this object. Used by qsh for command completion and online help. |
| delete() | Delete the current stack from the layout. |
| doc(name) | Returns the documentation for a specified command name. Used by qsh to provide online help. |
| down() | Switch to the next window in this stack. |
| info() | Return 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. |
| next() | Focus next stack. |
| previous() | Focus previous stack. |
| rotate() | Rotate order of the stacks. |
| shuffle_down() | Shuffle the order of this stack down. |
| shuffle_up() | Shuffle the order of this stack up. |
| toggle_split() | Toggle vertical split on the current stack. |
| up() | Switch to the previous window in this stack. |
A simple layout that only displays one window at a time, filling the screen. This is suitable for use on laptops and other devices with small screens. Conceptually, the windows are managed as a stack, with commands to switch to next and previous windows in the stack.
class Max:
def __init__(self):
...
| 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. |
| down() | Switch down in the window list. |
| info() | Return 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. |
| up() | Switch up in the window list. |
from libqtile import layout
layouts = [
layout.Max(),
layout.Stack(stacks=2)
]
Copyright (c) 2010 Aldo Cortesi