aboutsummaryrefslogtreecommitdiff
path: root/src/usr/bin
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-04-01 17:07:54 -0400
committerB Stack <bgstack15@gmail.com>2020-04-02 09:06:38 -0400
commit3d0911850e5afa7b0f631b6c06dc2caefc38a15d (patch)
treeb80190c7e6bd5bd6e2a96fd4828910aa22b1be1d /src/usr/bin
parentmove debian/ to stackrpms (diff)
downloadlogout-manager-3d0911850e5afa7b0f631b6c06dc2caefc38a15d.tar.gz
logout-manager-3d0911850e5afa7b0f631b6c06dc2caefc38a15d.tar.bz2
logout-manager-3d0911850e5afa7b0f631b6c06dc2caefc38a15d.zip
fix #2 and #3 distro name
python 3.8 removed platform.platform() in favor of distro.linux_distribution(). This change uses the new format.
Diffstat (limited to 'src/usr/bin')
-rwxr-xr-xsrc/usr/bin/logout-manager-trayicon14
1 files changed, 10 insertions, 4 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
bgstack15