From 6dbc9804fdf8c4b32459b67a2b0698942e4291d0 Mon Sep 17 00:00:00 2001 From: airclay Date: Sat, 4 Sep 2021 16:24:48 -0500 Subject: [PATCH] WIP --- systrayUpdater.py | 11 ++++++++--- systrayupdater.yml | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 systrayupdater.yml diff --git a/systrayUpdater.py b/systrayUpdater.py index 734b1fb..7524759 100755 --- a/systrayUpdater.py +++ b/systrayUpdater.py @@ -3,6 +3,7 @@ # Get needed modules import yaml import subprocess +from os import path from PyQt5.QtCore import QTimer from PyQt5.QtGui import * from PyQt5.QtWidgets import * @@ -12,11 +13,15 @@ avail = "" # Use config.yml file to allow for compatibility with # most terminal emulators possible & custom icon -with open('config.yml') as f: +confPath = "~/.config/systrayUpdater/systrayUpdater.yml" +conf = path.expanduser(confPath) +with open(conf) as f: conf = yaml.load(f, yaml.FullLoader) term = str(conf['terminal']) opt = str(conf['option']) - icn = str(conf['icon']) + wait = int(conf['timer']) * 60000 + icnPath = "~/.config/systrayUpdater/" + str(conf['icon']) + icn = path.expanduser(icnPath) f.close() # Run checkupdates command @@ -65,7 +70,7 @@ menu.addAction(option1) # Set up timer to update count timer = QTimer() timer.timeout.connect(newText) -timer.start(600000) +timer.start(wait) # To quit the app quit = QAction("Quit") diff --git a/systrayupdater.yml b/systrayupdater.yml new file mode 100644 index 0000000..1dac1f4 --- /dev/null +++ b/systrayupdater.yml @@ -0,0 +1,3 @@ +terminal: terminator +option: -x +icon: white-logo.png