From b581e697cdb01c63f14ffeb550b5cd94da59c299 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 2 Aug 2019 23:13:55 -0300 Subject: [PATCH] AUR desktop entry file refactored --- aur/desktop_entry.py | 29 ----------------------------- aur/panel_entry.py | 17 +++++++++++++++++ aur/tray_entry.py | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 29 deletions(-) delete mode 100644 aur/desktop_entry.py create mode 100644 aur/panel_entry.py create mode 100644 aur/tray_entry.py diff --git a/aur/desktop_entry.py b/aur/desktop_entry.py deleted file mode 100644 index cf6680cb..00000000 --- a/aur/desktop_entry.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generates a .desktop file based on the current python version. Used for AUR installation -import os -import sys -from pathlib import Path - -desktop_file = """ -[Desktop Entry] -Type = Application -Name = fpakman{desc} -Categories = System; -Comment = Manage your Flatpak / Snap applications -Exec = /usr/bin/fpakman{param} -Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg -""" - -py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) - -with open('fpakman.desktop', 'w+') as f: - f.write(desktop_file.format(desc='', version=py_version, param=' --tray 0')) - -with open('fpakman_tray.desktop', 'w+') as f: - f.write(desktop_file.format(desc=' ( tray )', version=py_version, param='')) - - -# cleaning the old fpakman.desktop entry model -> the following lines will be removed for the next releases -desktop_file_path = '{}/.local/share/applications/fpakman.desktop'.format(str(Path.home())) - -if os.path.exists(desktop_file_path): - os.remove(desktop_file_path) diff --git a/aur/panel_entry.py b/aur/panel_entry.py new file mode 100644 index 00000000..a2e2887e --- /dev/null +++ b/aur/panel_entry.py @@ -0,0 +1,17 @@ +# Generates a .desktop file based on the current python version. Used for AUR installation +import sys + +desktop_file = """ +[Desktop Entry] +Type = Application +Name = fpakman +Categories = System; +Comment = Manage your Flatpak / Snap applications +Exec = /usr/bin/fpakman --tray=0 +Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg +""" + +py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) + +with open('fpakman.desktop', 'w+') as f: + f.write(desktop_file.format(version=py_version)) diff --git a/aur/tray_entry.py b/aur/tray_entry.py new file mode 100644 index 00000000..881a95e6 --- /dev/null +++ b/aur/tray_entry.py @@ -0,0 +1,17 @@ +# Generates a .desktop file based on the current python version. Used for AUR installation +import sys + +desktop_file = """ +[Desktop Entry] +Type = Application +Name = fpakman ( tray ) +Categories = System; +Comment = Manage your Flatpak / Snap applications +Exec = /usr/bin/fpakman +Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg +""" + +py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) + +with open('fpakman_tray.desktop', 'w+') as f: + f.write(desktop_file.format(version=py_version))