diff --git a/bumblebee/modules/pacman.py b/bumblebee/modules/pacman.py index b5921a7..3a24f5f 100644 --- a/bumblebee/modules/pacman.py +++ b/bumblebee/modules/pacman.py @@ -1,6 +1,9 @@ # pylint: disable=C0111,R0903 -"""Displays update information per repository for pacman." +"""Displays update information per repository for pacman. + +Parameters: + * pacman.sum: If you prefere displaying updates with a single digit (defaults to "False") Requires the following executables: * fakeroot @@ -45,8 +48,12 @@ class Module(bumblebee.engine.Module): bumblebee.output.Widget(full_text=self.updates) ) self._count = 0 + self._sum = True if self.parameter("sum") == "True" else False + def updates(self, widget): + if (self._sum): + return str(sum(map(lambda x: widget.get(x, 0), repos))) return '/'.join(map(lambda x: str(widget.get(x, 0)), repos)) def update(self, widgets):