-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
143 lines (119 loc) · 3.85 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
from modules.keys import keys, mod
from modules.groups import groups
from modules.layouts import layouts, floating_layout
from modules.screens import screens
from modules.mouse import mouse
from os import environ, wait
from os.path import expanduser
import shlex
from subprocess import Popen
from libqtile.log_utils import logger
from logging import WARNING
from libqtile import hook, qtile
from libqtile.lazy import lazy
qtilecore = qtile.core.name
qtile_core = str(qtilecore).lower()
def blab(s):
logger.log(msg=s, exc_info=True, level=WARNING)
mod = mod
keys = keys
groups = groups
layouts = layouts
floating_layout = floating_layout
screens = screens
mouse = mouse
widget_defaults = dict(
font="LiterationSans\ Nerd\ Font:h13",
fontsize=14,
custom_icon_paths=[
expanduser("~/.config/qtile/icons"),
expanduser("~/.local/share/icons/default"),
],
)
extension_defaults = widget_defaults.copy()
# environment variables
environ["QT_QPA_PLATFORMTHEME"] = "qt6ct"
environ["NEOVIDE_MULTIGRID"] = "true"
environ['XCURSOR_SIZE'] = "48"
environ['XCURSOR_THEME'] = "capitaine-cursors-light"
auto_fullscreen = True
auto_minimize = False
bring_front_click = True
cursor_warp = False
focus_on_window_activation = "smart"
follow_mouse_focus = True
reconfigure_screens = True
wmname = "qtile"
group_app_subscriptions = [
["null"], # 0, any w/o a script
["1 ", "alacritty", "kitty", "wezterm", "konsole"], # Group 1
[
"2 ",
"Firefox",
"firefox",
"firefox-developer-edition",
"chromium",
"qutebrowser",
"librewolf",
"vivaldi",
"Chromium",
"angelfish",
"midori",
"firedragon",
], # Group 2
["3 ", "vim", "nvim", "nvim-qt", "neovide", "kate"], # Group 3
["4 ", "codium-insiders", "vscodium", "geany", "kdevelop"], # Group 4
["5 ", "dolphin", "pcmanfm-qt", "thunar"], # Group 5
["6 ", "telegram", "caprine", "hexchat"], # Group 6
["7 ", "spotify", "xmms"], # Group 7
["8 ", "gnu image manipulation program"], # Group 8
["9 ", "null"], # Group 9
]
autostarts = [
"dbus-update-activation-environment --systemd --all",
"systemctl --user import-environment XCURSOR_THEME XCURSOR_SIZE DISPLAY WAYLAND_DISPLAY XDG_SESSION_DESKTOP XDG_RUNTIME_DIR",
"dex -as ~/.config/autostart",
"dunst",
"sh -c ~/.local/bin/remap-capslock.sh",
"sh -c ~/.local/bin/conky-startup.sh",
]
if qtile_core == "x11":
autostarts.extend(["picom"])
elif qtile_core == "wayland":
autostarts.extend(["Xwayland enable"])
autostarts_running = []
@hook.subscribe.client_new
def send_to_proper_workspace(client):
for gsub in group_app_subscriptions:
client_info = client.info()
client_name = str(client_info["name"]).lower()
client_wm_class = str(client_info["wm_class"][1]).lower()
if client_name in gsub:
blab("Match name: %s" % client_name)
client.togroup(gsub[0], switch_group=True)
break
elif client_wm_class in gsub:
blab("Match class: %s" % client_wm_class)
client.togroup(gsub[0], switch_group=True)
break
# else:
# blab("No match for name: %s " % client_name)
# blab("%s" % client_info)
@hook.subscribe.client_new
def dialogs(window):
if window.window.get_wm_type == "dialog":
window.floating = True
lazy.window.center(window)
@hook.subscribe.startup_complete
def autostart():
blab("Beginning autostart() procedure")
for p in autostarts:
ppath = expanduser(p)
proc = shlex.split(ppath)
subproc = Popen(proc)
autostarts_running.append(subproc)
@hook.subscribe.shutdown
def cleanup():
for p in autostarts_running:
blab("Killing process: " + str(p.args) + " (pid " + str(p.pid) + ") ...")
p.kill()