summaryrefslogtreecommitdiff
path: root/.config/qtile/config.py
blob: 4d577b1d44d11125d2d7d0b69b852464b98dd035 (about) (plain)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
import os
import subprocess
from libqtile import layout, bar, widget, hook
from libqtile.config import Click, Drag, Group, Match, Screen, Rule
from libqtile.command import lazy
from keys import MyKeys
from libqtile.dgroups import simple_key_binder
from colors import gruvbox, nord_fox, my_colors, dracula
from spotify_widget import Spotify

@hook.subscribe.startup_once
def start_once():
    autostart_path = os.path.expanduser('~/.config/autostart/autostart.sh')
    subprocess.run([autostart_path])

## Keybindings
my_keys = MyKeys(mod="mod4",
                 browser="qutebrowser",
                 term="alacritty",
                 editor = "emacsclient -c -a 'emacs'")

keys = my_keys.init_keys()
dgroups_key_binder = simple_key_binder("mod4")
mouse = my_keys.init_mouse()
## Groups and layouts
groups = []
group_names = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0",]
group_labels = ["Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ", "Ⅹ",]
group_layouts = ["monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall",]

for i in range(len(group_names)):
    groups.append(
        Group(
            name=group_names[i],
            layout=group_layouts[i].lower(),
            label=group_labels[i],
        ))

def init_layout_theme():
    return {"margin":5,
            "border_width":2,
            "border_focus": "#5e81ac",
            "border_normal": "#4c566a"
            }

layout_theme = init_layout_theme()


layouts = [
    #layout.MonadTall(margin=8, border_width=2, border_focus="#5e81ac", border_normal="#4c566a"),
    layout.MonadTall(**layout_theme),
    #layout.MonadWide(margin=8, border_width=2, border_focus="#5e81ac", border_normal="#4c566a"),
    # layout.MonadWide(**layout_theme),
    # layout.Matrix(**layout_theme),
    # layout.Bsp(**layout_theme),
    layout.Floating(**layout_theme),
    # layout.RatioTile(**layout_theme),
    layout.Max(**layout_theme)
]

# Widgets

def init_widgets_defaults():
    return dict(font="Noto Sans",
                fontsize = 12,
                padding = 2,
                foreground =dracula["fg"],
                background = dracula["bg"]
                )

widget_defaults = init_widgets_defaults()

def init_widgets_list():
    widgets_list = [
            widget.Spacer(
                length=7,
            ),
            widget.Image(
                filename = "~/.config/qtile/rms.png",
                scale = "True",
            ),
            widget.Spacer(
                length=7,
            ),
            widget.GroupBox(
                font="FontAwesome",
                fontsize = 20,
                padding = 3,
                margin = 4,
                borderwidth = 1,
                active = dracula["cyan"],
                inactive = dracula["curr"],
                rounded = False,
                highlight_method = "line",
                this_current_screen_border = dracula["red"],
                other_current_screen_border = dracula["curr"],
            ),
            widget.CurrentLayout(
                font = "Noto Sans Bold",
                foreground = dracula["fg"],
                background = "#5B4B8A",
            ),
            widget.Spacer(
                length=5
            ),
            widget.WindowName(
                font="JetBrains Mono Bold",
                fontsize = 12,
                foreground = dracula["green"],
                background = dracula["bg"]
            ),
            #widget.Notify(
            #     font = "sansmono",
            #     fontsize = "14",
            # ),
            #widget.Pomodoro(
            #     font = 'sansmono',
            #     fontsize = 17,
            #     color_inactive = my_colors['blue'],
            #     length_pomodori = 35,
            # ),
            #widget.Sep(
            #     linewidth = 1,
            #     padding = 10,
            #     foreground = my_colors["black2"],
            #     background = my_colors["black"]
            # ),
            # widget.TextBox(
            #      font="FontAwesome",
            #      text= '|' + str(subprocess.check_output("uname -r", shell=True).strip()).replace('b','') + '|',
            #      foreground=my_colors["grey2"],
            #      background=my_colors["black"],
            #      padding = 0,
            #      fontsize=14
            #  ),
            widget.Sep(
                linewidth = 1,
                padding = 10,
                foreground = my_colors["black2"],
                background = dracula["bg"]
            ),
            Spotify(
                fontsize = 12,
                background = dracula["bg"],
                color = dracula["green"],
                fmt = '{}',
                font = "JetBrains Mono Bold"
            ),
            widget.Volume(
                fontsize = 13,
                fmt = '|{}| ' ,
                background = dracula["bg"],
                foreground = dracula['purple'],
                font = "JetBrains Mono"
            ),
            # widget.Mpris2(
            #     fontsize= 16,
            #     background = my_colors["red"],
            #     objname="org.mpris.MediaPlayer2.spotify"
            # ),
            widget.Sep(
                linewidth = 1,
                padding = 10,
                foreground = my_colors["black2"],
                background = dracula["bg"]
            ),
            widget.Memory(
                measure_mem="G",
                fontsize=15,
                foreground = dracula["cyan"],
                background = dracula["bg"],
                font='JetBrains Mono Bold',
            ),
            widget.MemoryGraph(
                type='box',
                graph_color = dracula["cyan"],
                foreground = dracula["fg"],
                background = dracula["bg"],
            ),
            widget.Sep(
                linewidth = 1,
                padding = 10,
                foreground = my_colors["black2"],
                background = dracula["bg"],
            ),
            widget.ThermalSensor(
                threshold=50,
                fontsize=15,
                font='JetBrains Mono Bold',
                foreground = dracula["cyan"],
                background = dracula["bg"],
            ),
            widget.CPUGraph(
                type='box',
                graph_color = dracula["cyan"],
                background = dracula["bg"],
            ),
            widget.Sep(
                linewidth = 1,
                padding = 10,
                foreground = my_colors["black2"],
                background = dracula["bg"],
            ),
            widget.TextBox(
                font="FontAwesome",
                text="  ",
                foreground=dracula["orange"],
                background=dracula["bg"],
                padding = 2,
                fontsize=18
            ),
            widget.Clock(
                font='JetBrains Mono Bold',
                foreground = dracula["cyan"],
                background = dracula["bg"],
                fontsize = 18,
                format="%d-%m-%Y | %H:%M"
            ),
            widget.Sep(
                linewidth = 1,
                padding = 3,
                foreground = my_colors["black2"],
                background = dracula["bg"]
            ),
            widget.Systray(
                background= dracula["bg"],
                icon_size=21,
                padding = 10
            ),
            widget.Sep(
                linewidth = 1,
                padding = 20,
                foreground = my_colors["black2"],
                background = dracula["bg"]
            ),

        ]
    return widgets_list
def init_bot_widgets():
    bot_widgets = [
            widget.Spacer(
                length=7,
            ),
            widget.Image(
                filename = "~/Pictures/rms/rms.png",
                scale = "True",
            ),
            widget.Spacer(
                length=7,
            ),
            widget.Spacer(
                length=5
            ),
            widget.WindowName(
                font="JetBrains Mono Bold",
                fontsize = 12,
                foreground = dracula["green"],
                background = dracula["bg"]
            ),
            widget.Spacer(
                length=7,
            ),
            widget.Sep(
                linewidth = 1,
                padding = 10,
                foreground = my_colors["black2"],
                background = dracula["bg"]
            ),
            widget.Memory(
                measure_mem="G",
                fontsize=15,
                foreground = dracula["cyan"],
                background = dracula["bg"],
                font='JetBrains Mono Bold',
            ),
            widget.MemoryGraph(
                type='box',
                graph_color = dracula["cyan"],
                foreground = dracula["fg"],
                background = dracula["bg"],
            ),
            widget.Sep(
                linewidth = 1,
                padding = 10,
                foreground = my_colors["black2"],
                background = dracula["bg"],
            ),
            widget.ThermalSensor(
                threshold=50,
                fontsize=15,
                font='JetBrains Mono Bold',
                foreground = dracula["cyan"],
                background = dracula["bg"],
            ),
            widget.CPUGraph(
                type='box',
                graph_color = dracula["cyan"],
                background = dracula["bg"],
            ),
            widget.Sep(
                linewidth = 1,
                padding = 10,
                foreground = my_colors["black2"],
                background = dracula["bg"],
            ),

           widget.TextBox(
                font="FontAwesome",
                text="  ",
                foreground=dracula["orange"],
                background=dracula["bg"],
                padding = 2,
                fontsize=18
            ),
            widget.Clock(
                font='JetBrains Mono Bold',
                foreground = dracula["cyan"],
                background = dracula["bg"],
                fontsize = 18,
                format="%d-%m-%Y | %H:%M"
            ),
            widget.Sep(
                linewidth = 1,
                padding = 3,
                foreground = my_colors["black2"],
                background = dracula["bg"]
            ),

        ]
    return bot_widgets


widgets_list = init_widgets_list()


def init_widgets_screen1():
    widgets_screen1 = init_widgets_list()
    return widgets_screen1

def init_widgets_screen2():
    widgets_screen2 = init_widgets_list()
    return widgets_screen2[:-2]

widgets_screen1 = init_widgets_screen1()
widgets_screen2 = init_widgets_screen2()


def init_screens():
    return [Screen(top=bar.Bar(widgets=init_widgets_screen1(), size=33, margin = [6,20,3,20]),),
            Screen(top=bar.Bar(widgets=init_widgets_screen2(), size=28, margin = 7))]



screens = init_screens()

follow_mouse_focus = True
bring_front_click = False
cursor_warp = True
auto_fullscreen = True

focus_on_window_activation = "smart" # or smart


wmname = "Qtile-Apo11o"