From 8946322bd5128cef05ff294c41d648ab61483843 Mon Sep 17 00:00:00 2001 From: Antonin Dach Date: Sat, 12 May 2018 20:23:55 +0200 Subject: [PATCH] [modul pacman] - enable suming up all updates to save screen real estate --- bumblebee/modules/pacman.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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):