forked from DYefremov/DemonEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.py
More file actions
executable file
·29 lines (22 loc) · 806 Bytes
/
start.py
File metadata and controls
executable file
·29 lines (22 loc) · 806 Bytes
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
#!/usr/bin/env python3
import os
def update_icon():
need_update = False
icon_name = "demon-editor.desktop"
with open(icon_name, "r", encoding="utf-8") as f:
lines = f.readlines()
for i, line in enumerate(lines):
if line.startswith("Icon="):
icon_path = line.lstrip("Icon=")
current_path = f"{os.getcwd()}/app/ui/icons/hicolor/96x96/apps/demon-editor.png"
if icon_path != current_path:
need_update = True
lines[i] = f"Icon={current_path}\n"
break
if need_update:
with open(icon_name, "w", encoding="utf-8") as f:
f.writelines(lines)
if __name__ == "__main__":
from app.ui.main import start_app
update_icon()
start_app()