diff options
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/bin/logout-manager-trayicon | 14 | ||||
-rw-r--r-- | src/usr/share/logout-manager/lmlib.py | 10 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/usr/bin/logout-manager-trayicon b/src/usr/bin/logout-manager-trayicon index b6471f9..012e2bd 100755 --- a/src/usr/bin/logout-manager-trayicon +++ b/src/usr/bin/logout-manager-trayicon @@ -2,6 +2,11 @@ # File: logout-manager-trayicon # License: CC-BY-SA 4.0 # Author: bgstack15 +# Startdate: 2020-03-20 +# Title: Logout Manager tray icon +# Purpose: An easy menu from the system tray in a panel for a window manager or desktop environment +# History: +# 2020-04-01 update for python 3.8 # Reference: # icon work https://stackoverflow.com/questions/45162862/how-do-i-set-an-icon-for-the-whole-application-using-pygobject # button right click must be from "button-press-event" and import Gdk https://python-gtk-3-tutorial.readthedocs.io/en/latest/menus.html @@ -15,10 +20,11 @@ # send signals https://stackoverflow.com/questions/15080500/how-can-i-send-a-signal-from-a-python-program # https://docs.python.org/3.8/library/signal.html#module-signal # Dependencies: -# dep-pip: psutil -# dep-devuan: python3-psutil +# dep-pip: psutil distro +# dep-devuan: python3-psutil python3-distro -import gi, os, platform, re, sys, psutil, signal +import gi, os, re, sys, psutil, signal +from distro import linux_distribution gi.require_version("Gtk","3.0") from gi.repository import Gtk from gi.repository import Gdk @@ -27,7 +33,7 @@ from dotenv import load_dotenv # all this to load the libpath try: defaultdir="/etc/sysconfig" - thisplatform = platform.platform().lower() + thisplatform = linux_distribution()[0].lower() if 'debian' in thisplatform or 'devuan' in thisplatform: defaultdir="/etc/default" # load_dotenv keeps existing environment variables as higher precedent diff --git a/src/usr/share/logout-manager/lmlib.py b/src/usr/share/logout-manager/lmlib.py index 40ee3a0..0bf0a0c 100644 --- a/src/usr/share/logout-manager/lmlib.py +++ b/src/usr/share/logout-manager/lmlib.py @@ -12,8 +12,11 @@ # platform info https://stackoverflow.com/questions/110362/how-can-i-find-the-current-os-in-python/10091465#10091465 # Improve: # Documentation: +# Dependencies: +# dep-devuan: python3-distro -import configparser, platform, os, subprocess +import configparser, os, subprocess +from distro import linux_distribution logout_manager_version="2020-03-10a" @@ -260,9 +263,10 @@ def Initialize_config(infile): # set icon category # written primarily for el7 which uses "app" for the system-reboot icons, etc. - a = platform.dist() + a, b, _ = linux_distribution() + a = a.lower() try: - if a[0] == "redhat" and int(a[1].split(".")[0]) <= 7: + if ("red hat" in a or "redhat" in a) and int(b.split(".")[0]) <= 7: config.set_icon_category("apps") except: pass |