2017-11-09 19:01:09 +03:00
|
|
|
#!/usr/bin/env python3
|
2020-01-15 07:26:59 +03:00
|
|
|
import os
|
2017-11-09 19:01:09 +03:00
|
|
|
|
2020-01-15 07:26:59 +03:00
|
|
|
|
|
|
|
|
def update_icon():
|
|
|
|
|
need_update = False
|
|
|
|
|
icon_name = "DemonEditor.desktop"
|
|
|
|
|
|
|
|
|
|
with open(icon_name, "r") as f:
|
|
|
|
|
lines = f.readlines()
|
|
|
|
|
for i, line in enumerate(lines):
|
|
|
|
|
if line.startswith("Icon="):
|
|
|
|
|
icon_path = line.lstrip("Icon=")
|
|
|
|
|
current_path = "{}/app/ui/icons/hicolor/96x96/apps/demon-editor.png".format(os.getcwd())
|
|
|
|
|
if icon_path != current_path:
|
|
|
|
|
need_update = True
|
|
|
|
|
lines[i] = "Icon={}\n".format(current_path)
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
if need_update:
|
|
|
|
|
with open(icon_name, "w") as f:
|
|
|
|
|
f.writelines(lines)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2021-08-15 14:37:21 +03:00
|
|
|
from app.ui.main import start_app
|
2020-01-15 07:26:59 +03:00
|
|
|
|
|
|
|
|
update_icon()
|
|
|
|
|
start_app()
|