--tray default to 0

This commit is contained in:
Vinicius Moreira
2019-08-09 10:26:47 -03:00
parent 6313da8a7b
commit 1930d5d54b
5 changed files with 16 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- suggestions are now retrieved asynchronously taking 45% less time. - suggestions are now retrieved asynchronously taking 45% less time.
- search response takes an average of 20% less time ( reaching 35% for several results ) - search response takes an average of 20% less time ( reaching 35% for several results )
- app boot takes 98% less time when snapd is installed, but disabled - app boot takes 98% less time when snapd is installed, but disabled
- FPAKMAN_TRAY (--tray) is not enabled by default (0).
### Fixes: ### Fixes:
- [flatpak dependency](https://github.com/vinifmor/fpakman/issues/36) - [flatpak dependency](https://github.com/vinifmor/fpakman/issues/36)

View File

@@ -52,7 +52,7 @@ You can change some application settings via environment variables or arguments
- **FPAKMAN_FLATPAK**: enables / disables flatpak usage. Use **0** (disable) or **1** (enabled, default) - **FPAKMAN_FLATPAK**: enables / disables flatpak usage. Use **0** (disable) or **1** (enabled, default)
- **FPAKMAN_SNAP**: enables / disables snap usage. Use **0** (disable) or **1** (enabled, default) - **FPAKMAN_SNAP**: enables / disables snap usage. Use **0** (disable) or **1** (enabled, default)
- **FPAKMAN_CHECK_PACKAGING_ONCE**: If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Use **0** (disable, default) or **1** (enable). - **FPAKMAN_CHECK_PACKAGING_ONCE**: If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Use **0** (disable, default) or **1** (enable).
- **FPAKMAN_TRAY**: If the tray icon and update-check daemon should be created. Use **0** (disable) or **1** (enable, default). - **FPAKMAN_TRAY**: If the tray icon and update-check daemon should be created. Use **0** (disable, default) or **1** (enable).
- **FPAKMAN_SUGGESTIONS**: If application suggestions should be displayed if no app is installed (runtimes do not count as apps). Use **0** (disable) or **1** (enable, default). - **FPAKMAN_SUGGESTIONS**: If application suggestions should be displayed if no app is installed (runtimes do not count as apps). Use **0** (disable) or **1** (enable, default).
### How to improve the application performance ### How to improve the application performance

View File

@@ -1,4 +1,5 @@
# Generates a .desktop file based on the current python version. Used for AUR installation # Generates a .desktop file based on the current python version. Used for AUR installation
import os
import sys import sys
desktop_file = """ desktop_file = """
@@ -7,11 +8,13 @@ Type = Application
Name = fpakman Name = fpakman
Categories = System; Categories = System;
Comment = Manage your Flatpak / Snap applications Comment = Manage your Flatpak / Snap applications
Exec = /usr/bin/fpakman --tray=0 Exec = {path}
Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg Icon = {lib_path}/python{version}/site-packages/fpakman/resources/img/logo.svg
""" """
py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor)
with open('fpakman.desktop', 'w+') as f: with open('fpakman.desktop', 'w+') as f:
f.write(desktop_file.format(version=py_version)) f.write(desktop_file.format(lib_path=os.getenv('FPAKMAN_LIB_PATH', '/usr/lib'),
version=py_version,
path=os.getenv('FPAKMAN_PATH', '/usr/bin/fpakman')))

View File

@@ -1,17 +1,20 @@
# Generates a .desktop file based on the current python version. Used for AUR installation # Generates a .desktop file based on the current python version. Used for AUR installation
import os
import sys import sys
desktop_file = """ desktop_file = """
[Desktop Entry] [Desktop Entry]
Type = Application Type = Application
Name = fpakman ( tray ) Name = fpakman
Categories = System; Categories = System;
Comment = Manage your Flatpak / Snap applications Comment = Manage your Flatpak / Snap applications
Exec = /usr/bin/fpakman Exec = {path} --tray=1
Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg Icon = {lib_path}/python{version}/site-packages/fpakman/resources/img/logo.svg
""" """
py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor)
with open('fpakman_tray.desktop', 'w+') as f: with open('fpakman_tray.desktop', 'w+') as f:
f.write(desktop_file.format(version=py_version)) f.write(desktop_file.format(lib_path=os.getenv('FPAKMAN_LIB_PATH', '/usr/lib'),
version=py_version,
path=os.getenv('FPAKMAN_PATH', '/usr/bin/fpakman')))

View File

@@ -45,7 +45,7 @@ parser.add_argument('-di', '--download-icons', action="store", choices=[0, 1], d
parser.add_argument('--flatpak', action="store", default=os.getenv('FPAKMAN_FLATPAK', 1), choices=[0, 1], type=int, help='Enables / disables flatpak usage. Default: %(default)s') parser.add_argument('--flatpak', action="store", default=os.getenv('FPAKMAN_FLATPAK', 1), choices=[0, 1], type=int, help='Enables / disables flatpak usage. Default: %(default)s')
parser.add_argument('--snap', action="store", default=os.getenv('FPAKMAN_SNAP', 1), choices=[0, 1], type=int, help='Enables / disables snap usage. Default: %(default)s') parser.add_argument('--snap', action="store", default=os.getenv('FPAKMAN_SNAP', 1), choices=[0, 1], type=int, help='Enables / disables snap usage. Default: %(default)s')
parser.add_argument('-co', '--check-packaging-once', action="store", default=os.getenv('FPAKMAN_CHECK_PACKAGING_ONCE', 0), choices=[0, 1], type=int, help='If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Default: %(default)s') parser.add_argument('-co', '--check-packaging-once', action="store", default=os.getenv('FPAKMAN_CHECK_PACKAGING_ONCE', 0), choices=[0, 1], type=int, help='If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Default: %(default)s')
parser.add_argument('--tray', action="store", default=os.getenv('FPAKMAN_TRAY', 1), choices=[0, 1], type=int, help='If the tray icon and update-check daemon should be created. Default: %(default)s') parser.add_argument('--tray', action="store", default=os.getenv('FPAKMAN_TRAY', 0), choices=[0, 1], type=int, help='If the tray icon and update-check daemon should be created. Default: %(default)s')
parser.add_argument('--sugs', action="store", default=os.getenv('FPAKMAN_SUGGESTIONS', 1), choices=[0, 1], type=int, help='If app suggestions should be displayed if no app is installed (runtimes do not count as apps). Default: %(default)s') parser.add_argument('--sugs', action="store", default=os.getenv('FPAKMAN_SUGGESTIONS', 1), choices=[0, 1], type=int, help='If app suggestions should be displayed if no app is installed (runtimes do not count as apps). Default: %(default)s')
args = parser.parse_args() args = parser.parse_args()