[all] Refactor module <-> output communication
Modules now return "bumblebee.output.Widget" objects, so that they can actually define a list of items to be drawn in the bar.
This commit is contained in:
parent
7f91b8298f
commit
bab7821607
6 changed files with 223 additions and 131 deletions
|
@ -31,7 +31,11 @@ class Module(bumblebee.module.Module):
|
|||
param_name = "{}.format".format(module)
|
||||
self._fmt = config.parameter(param_name, default)
|
||||
|
||||
def data(self):
|
||||
return datetime.datetime.now().strftime(self._fmt)
|
||||
def widgets(self):
|
||||
return [
|
||||
bumblebee.output.Widget(
|
||||
datetime.datetime.now().strftime(self._fmt)
|
||||
)
|
||||
]
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue