Changing 'register_app.py' to generate the .desktop file to local dir

This commit is contained in:
Vinicius Moreira
2019-06-24 15:08:13 -03:00
parent cc8b5f39af
commit 009503fa36

24
aur/desktop_entry.py Normal file
View File

@@ -0,0 +1,24 @@
# used for AUR installation
import os
import sys
from pathlib import Path
desktop_file = """
[Desktop Entry]
Type = Application
Name = fpakman
Categories = System;
Comment = Manage your Flatpak applications
Exec = /usr/bin/fpakman
Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/flathub_45.svg
""".format(version="{}.{}".format(sys.version_info.major, sys.version_info.minor))
apps_path = '{}/.local/share/applications'.format(str(Path.home()))
if not os.path.exists(apps_path):
os.mkdir(apps_path)
file_path = 'fpakman.desktop'.format(apps_path)
with open(file_path, 'w+') as f:
f.write(desktop_file)