A simple replacement for i3status that is both extensible and customizable.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
841 B

import plugins
import subprocess
'cmd': ('/usr/bin/pacman', '-Qu'),
'title': 'UPD', 'freq': 15, 'problem': 10
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
super(PluginThread, self).__init__(config, PACMAN_DEFAULTS)
def main(self):
pacman_qu = subprocess.Popen(
self.conf['cmd'], stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL,
out = pacman_qu.communicate()[0].strip().splitlines()
packages = len([pkg for pkg in out if not '[ignored]' in pkg])
if packages:
self.hide = False
self.hide = True
str(packages), urgent=packages >= self.conf['problem']