-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert.py
More file actions
executable file
·32 lines (23 loc) · 793 Bytes
/
convert.py
File metadata and controls
executable file
·32 lines (23 loc) · 793 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
30
31
#!/usr/bin/env python3
import os
import sys
from app.converter import Application
def update_icon():
need_update = False
with open("ffmpeg-gtk.desktop", "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/img/logo.png"
if icon_path != current_path:
need_update = True
lines[i] = f"Icon={current_path}\n"
break
if need_update:
with open("ffmpeg-gtk.desktop", "w", encoding="utf-8") as f:
f.writelines(lines)
if sys.platform == "linux":
update_icon()
app = Application()
app.run(sys.argv)