Cleaning .desktop file when installing

This commit is contained in:
Vinicius Moreira
2019-06-17 14:31:54 -03:00
parent 2399868168
commit 8f7cdbfa36

View File

@@ -22,13 +22,16 @@ Exec = /usr/bin/fpakman
Icon = {resource_path}/resources/img/flathub_45.svg
""".format(resource_path=local_resources_path)
apps_path = '{}/.local/share/applications'.format(str(Path.home()))
apps_path = share_path + '/applications'
if not os.path.exists(apps_path):
os.mkdir(apps_path)
file_path = apps_path + '/fpakman.desktop'
if os.path.exists(file_path):
os.remove(file_path)
with open(file_path, 'w+') as f:
f.write(desktop_file)