diff options
author | Von Random <von@vdrandom.org> | 2019-03-21 15:17:38 +0300 |
---|---|---|
committer | Von Random <von@vdrandom.org> | 2019-03-21 15:17:38 +0300 |
commit | 7459d29c68021c7dd87e1b8c8a29ce94dcdea346 (patch) | |
tree | 517976e97b2d7e86d52256caeea49faf1a2687a7 | |
parent | de6888a5d235db7ccdfeb2462a0eff368a55b135 (diff) |
pacman plugin: not so much pacman anymore, but line counter; still defaults to pacman though
-rw-r--r-- | plugins/pacman.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/pacman.py b/plugins/pacman.py index ccf0550..b5e595b 100644 --- a/plugins/pacman.py +++ b/plugins/pacman.py @@ -5,6 +5,8 @@ import subprocess class PluginThread(plugins.PluginThreadCommon): def __init__(self, config): defaults = { + 'cmd': ('/usr/bin/pacman', '-Qu'), + 'title': 'UPD', 'freq': 15, 'problem': 10 } @@ -14,11 +16,11 @@ class PluginThread(plugins.PluginThreadCommon): def format_status(self, count): self.hide = count == 0 self.status['urgent'] = count >= self.conf['problem'] - self.status['full_text'] = 'UPD: ' + str(count) + self.status['full_text'] = self.conf['title'] + ': ' + str(count) def main(self): pacman_qu = subprocess.Popen( - ('/usr/bin/pacman', '-Qu'), stdout=subprocess.PIPE, + self.conf['cmd'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL, encoding='UTF-8' ) |