-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
149 lines (137 loc) · 4.3 KB
/
config.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
from libqtile.manager import Key, Click, Drag, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
mod = 'mod4'
# 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(
[mod], "k",
lazy.layout.down()
),
Key(
[mod], "j",
lazy.layout.up()
),
Key(
[mod, "control"], "k",
lazy.layout.shuffle_down()
),
Key(
[mod, "control"], "j",
lazy.layout.shuffle_up()
),
Key(
[mod], "space",
lazy.layout.next()
),
Key(
[mod, "shift"], "space",
lazy.layout.rotate()
),
Key(
[mod, "shift"], "Return",
lazy.layout.toggle_split()
),
Key([mod], "h", lazy.to_screen(1)),
Key([mod], "l", lazy.to_screen(0)),
# ~/bin/x starts a terminal program
Key([mod], "Tab", lazy.nextlayout()),
Key([mod], "w", lazy.window.kill()),
Key([mod], "F2", lazy.spawn(
"dmenu_run -p run -nb '#202020' -nf '#ffffff' -fa 'Anonymous Pro-10'")),
Key(
[mod, "shift"], "k",
lazy.spawn("amixer -c 0 -q set Master 2dB+")
),
Key(
[mod, "shift"], "j",
lazy.spawn("amixer -c 0 -q set Master 2dB-")
),
Key(
[mod], "Left", lazy.group.prevgroup(),
),
Key(
[mod], "Right", lazy.group.nextgroup(),
),
]
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(),
start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(),
start=lazy.window.get_size()),
Click([mod], "Button2", lazy.window.bring_to_front())
]
# Next, we specify group names, and use the group name list to generate an appropriate
# set of bindings for group switching.
groups = [
Group("1"),
Group("2"),
]
for i in groups:
keys.append(
Key(["mod4"], i.name, lazy.group[i.name].toscreen())
)
keys.append(
Key(["mod4", "shift"], i.name, lazy.window.togroup(i.name))
)
# Two simple layout instances:
layouts = [
layout.DecoratedStack(),
layout.Max(),
layout.Stack(stacks=2),
layout.Tile(),
]
screens = [
Screen(
top = bar.Bar(
[
widget.GroupBox(borderwidth=2,
fontsize=14,
padding=1, margin_x=1, margin_y=1),
widget.Sep(),
widget.WindowName(
fontsize=14, margin_x=6),
widget.Sep(),
widget.CPUGraph(width=50, graph_color='0066FF',
fill_color='001188'),
widget.MemoryGraph(width=50, graph_color='22FF44',
fill_color='11AA11'),
widget.SwapGraph(width=50, graph_color='FF2020',
fill_color='C01010'),
widget.Sep(),
widget.Systray(),
widget.Sep(),
widget.Clock('%H:%M %d/%m/%y',
fontsize=18, padding=6),
],
24
),
),
]
def main(qtile):
from dgroups import DGroups, Match
#'www': {'init': True, 'persist': True, 'spawn': ''},
groups = {
'h4x': {'init': True, 'persist': True, 'spawn': 'gnome-terminal'},
'design': {},
'emesene': {},
'gajim': {},
}
apps = [
{'match': Match(wm_class=['Gimp']),
'group': 'design', 'float': True},
{'match': Match(wm_class=['emesene']),
'group': 'emesene'},
{'match': Match(wm_class=['Gajim.py']),
'group': 'gajim'},
{'match': Match(wm_class=['Guake.py', 'MPlayer'],
wm_type=['dialog']), 'float': True},
{'match': Match(wm_class=['Wine']), 'float': True, 'group': 'wine'},
]
dgroups = DGroups(qtile, groups, apps)
@hook.subscribe.client_new
def dialogs(window):
if window.window.get_wm_type() == 'dialog':
window.floating = True