From 33cf50840d67211e9d1c1e37340a131ca1c4e476 Mon Sep 17 00:00:00 2001 From: airclay Date: Fri, 3 Sep 2021 08:36:39 -0500 Subject: [PATCH] WIP --- systrayUpdater.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) mode change 100644 => 100755 systrayUpdater.py diff --git a/systrayUpdater.py b/systrayUpdater.py old mode 100644 new mode 100755 index 8596965..bf49e49 --- a/systrayUpdater.py +++ b/systrayUpdater.py @@ -15,6 +15,7 @@ from PyQt5.QtGui import * from PyQt5.QtWidgets import * # Available Updates count holder +Nupd = [] avail = "" # Use config.yml file to allow for compatibility with @@ -33,8 +34,8 @@ def count(): p1 = subprocess.Popen(cmd, stdout=subprocess.PIPE) p2 = subprocess.Popen(['wc', '-l'], stdin=p1.stdout, stdout=subprocess.PIPE) output = ((p2.communicate()[0]).decode()).rstrip('\n') - Nupd = [] digit = str(output)+" Updates" + global Nupd Nupd.append(digit) global avail avail = Nupd[-1] @@ -78,4 +79,10 @@ menu.addAction(quit) # Adding options to the System Tray tray.setContextMenu(menu) +# Update the labels for available updates count +for i in Nupd: + option1.triggered.connect(lambda menuItem=text: self.dostuff(menuItem)) + option1.setText(text) + tray.setToolTip(text) + app.exec_()