[output] Allow modules to pass back a single widget

Since "single widget" is the 99% use-case, make it easier for a module
to return a single widget.
This commit is contained in:
Tobias Witek 2016-11-05 13:12:30 +01:00
parent 2cfb0997a0
commit 286aff2aa0
5 changed files with 9 additions and 14 deletions

View file

@ -22,9 +22,7 @@ class Module(bumblebee.module.Module):
self._capacity = int(f.read())
self._capacity = self._capacity if self._capacity < 100 else 100
return [
bumblebee.output.Widget(self,"{:02d}%".format(self._capacity))
]
return bumblebee.output.Widget(self,"{:02d}%".format(self._capacity))
def warning(self):
return self._capacity < self._config.parameter("battery.warning", 20)