-
Notifications
You must be signed in to change notification settings - Fork 2
/
theme.py
26 lines (19 loc) · 818 Bytes
/
theme.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
with open("/home/prtyksh/.config/waybar/config.jsonc") as f:
data = f.read()
ncolor1 = ""
ncolor2 = ""
with open("/home/prtyksh/.config/waybar/colors.txt") as colors:
color1 = colors.readline().strip()
color2 = colors.readline().strip()
print(color1,color2)
with open("/home/prtyksh/.cache/wal/py") as new:
ncolor1 = new.readline().strip()
ncolor2 = new.readline().strip()
print(ncolor1,ncolor2)
data = data.replace(color1,ncolor1)
data = data.replace(color2,ncolor2)
with open("/home/prtyksh/.config/waybar/config.jsonc","w") as wr:
wr.write(data)
with open("/home/prtyksh/.config/waybar/colors.txt","w") as w:
w.write(ncolor1+"\n")
w.write(ncolor2)