The keys variable defines Qtile's key bindings.
Defines a keybinding.
class Key:
def __init__(self, modifiers, key, *commands):
...
modifiers: A list of modifier specifications. Modifier specifications are one of: "shift", "lock", "control", "mod1", "mod2", "mod3", "mod4", "mod5".
key: A key specification, e.g. "a", "Tab", "Return", "space".
*commands: A list of lazy command objects generated with the command.lazy helper. If multiple Call objects are specified, they are run in sequence.
command.lazy is a special helper object to specify a command for later execution. This object acts like the root of the object graph, which means that we can specify a key binding command with the same syntax used to call the command through a script or through qsh.
from libqtile.manager import Key
keys = [
Key(
["mod1"], "k",
command.lazy.layout.down()
),
Key(
["mod1"], "j",
lazy.layout.up()
)
]
On my system mod1 is the Alt key - you can see which modifiers map to which keys on your system by running the xmodmap command. This example binds Alt-k to the "down" command on the current layout. This command is standard on all the included layouts, and switches to the next window (where "next" is defined differently in different layouts). The matching "up" command switches to the previous window.
Copyright (c) 2010 Aldo Cortesi