-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforce_fix.py
More file actions
37 lines (33 loc) · 1.23 KB
/
force_fix.py
File metadata and controls
37 lines (33 loc) · 1.23 KB
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
path = "/home/xscriptor/.config/hypr/windowrules.conf"
print(f"Reading {path}")
with open(path, 'r') as f:
lines = f.readlines()
new_lines = []
for i, line in enumerate(lines):
# Fix lines 37/38 specifically which are broken matches
if "pavucontrol" in line and "center" in line:
new_lines.append("windowrule = match:class ^(pavucontrol)$, center 1\n")
continue
if "blueman-manager" in line and "center" in line and "floating" in line:
new_lines.append("windowrule = match:class ^(blueman-manager)$, center 1\n")
continue
# Ensure xwayland block is commented
if line.strip().startswith("windowrule {"):
new_lines.append("# " + line)
continue
if "match:xwayland" in line:
new_lines.append("# " + line)
continue
if "match:floating =" in line: # block syntax style
new_lines.append("# " + line)
continue
if "rounding =" in line and "0" in line: # block syntax style
new_lines.append("# " + line)
continue
if line.strip() == "}":
new_lines.append("# " + line)
continue
new_lines.append(line)
print(f"Writing {len(new_lines)} lines to {path}")
with open(path, 'w') as f:
f.writelines(new_lines)