forked from ful1e5/Bibata_Cursor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit-manifest.py
31 lines (27 loc) · 1.18 KB
/
edit-manifest.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
import sys
def main():
args = sys.argv[1:]
metahl = args[0]
theme_name = args[1]
with open(metahl, 'r+') as f:
content = f.readlines()
f.seek(0)
f.truncate()
desc = "Hyprcursor version of bibata. "
shape = "rounded" if theme_name.split("-")[1] == "Modern" else "sharp"
if theme_name.endswith("-Amber"):
desc += "Yellowish and " + shape + " edge Bibata cursors"
elif theme_name.endswith("-Ice"):
desc += "White and " + shape + " edge Bibata cursors"
elif theme_name.endswith("-Classic"):
desc += "Black and " + shape + " edge Bibata cursors"
for line in content:
if not line.startswith("name = Extracted Theme") and not line.startswith("description = Automatically extracted with hyprcursor-util"):
f.write(line)
else:
if line.startswith("name = Extracted Theme"):
f.write("name = " + theme_name + "\n")
elif line.startswith("description = Automatically extracted with hyprcursor-util"):
f.write("description = " + desc + "\n")
if __name__ == '__main__':
main()