[core] Add (partial) support for states

Add states to the modules and widgets. Widgets are mostly just a
pass-through (backwards compatibility, and ease of use - making states
directly inside the widgets would require more code inside the modules
to ensure that each widget is correctly updated).

Still missing:
- Separators during partial update (right now, it takes one interval
until separators are drawn correctly)
This commit is contained in:
Tobias Witek 2020-02-23 21:13:49 +01:00
parent fd57af9325
commit 84833dc7db
5 changed files with 27 additions and 3 deletions

View file

@ -78,6 +78,8 @@ class i3(object):
def update(self, affected_modules=None):
for module in self._modules:
if affected_modules and not module.id() in affected_modules:
continue
module.update()
self._status[module] = self.widgets(module)