-
Notifications
You must be signed in to change notification settings - Fork 109
/
cortesi.py
123 lines (114 loc) · 2.86 KB
/
cortesi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
try:
from libqtile.manager import Key, Group
except ImportError:
from libqtile.config import Key, Group
from libqtile.manager import Click, Drag, Screen
from libqtile.command import lazy
from libqtile import layout, bar, widget
# The bindings below are for use with a Kinesis keyboard, and may not make
# sense for standard keyboards.
keys = [
# First, a set of bindings to control the layouts
Key(
["mod1"], "k",
lazy.layout.down()
),
Key(
["mod1"], "j",
lazy.layout.up()
),
Key(
["mod1", "control"], "k",
lazy.layout.shuffle_down()
),
Key(
["mod1", "control"], "j",
lazy.layout.shuffle_up()
),
Key(
["mod1"], "space",
lazy.layout.next()
),
Key(
["mod1", "shift"], "space",
lazy.layout.rotate()
),
Key(
["mod1", "shift"], "Return",
lazy.layout.toggle_split()
),
Key(["mod1"], "n", lazy.spawn("firefox")),
Key(["mod1"], "h", lazy.to_screen(1)),
Key(["mod1"], "l", lazy.to_screen(0)),
# ~/bin/x starts a terminal program
Key(["mod1"], "Return", lazy.spawn("~/bin/x")),
Key(["mod1"], "Tab", lazy.nextlayout()),
Key(["mod1"], "w", lazy.window.kill()),
# The bindings below control Amarok, and my sound volume.
Key(
["mod1", "shift"], "k",
lazy.spawn("amixer -c 1 -q set Speaker 2dB+")
),
Key(
["mod1", "shift"], "j",
lazy.spawn("amixer -c 1 -q set Speaker 2dB-")
),
Key(
["mod1", "shift"], "n",
lazy.spawn("amarok -t")
),
Key(
["mod1", "shift"], "l",
lazy.spawn("amarok -f")
),
Key(
["mod1", "shift"], "h",
lazy.spawn("amarok -r")
),
]
# Next, we specify group names, and use the group name list to generate an appropriate
# set of bindings for group switching.
groups = [
Group("a"),
Group("s"),
Group("d"),
Group("f"),
Group("u"),
Group("i"),
Group("o"),
Group("p"),
]
for i in groups:
keys.append(
Key(["mod1"], i.name, lazy.group[i.name].toscreen())
)
keys.append(
Key(["mod1", "shift"], i.name, lazy.window.togroup(i.name))
)
# Two simple layout instances:
layouts = [
layout.Max(),
layout.Stack(stacks=2)
]
# I have two screens, each of which has a Bar at the bottom. Each Bar has two
# simple widgets - a GroupBox, and a WindowName.
screens = [
Screen(
bottom = bar.Bar(
[
widget.GroupBox(),
widget.WindowName()
],
30,
),
),
Screen(
bottom = bar.Bar(
[
widget.GroupBox(),
widget.WindowName()
],
30,
),
)
]