[core/output] Evaluate "hidden()" callback of modules
This commit is contained in:
parent
f2e0d3c0ee
commit
f1341772e5
2 changed files with 5 additions and 0 deletions
|
@ -40,6 +40,9 @@ class Module(core.input.Object):
|
|||
|
||||
self.theme = theme
|
||||
|
||||
def hidden(self):
|
||||
return False
|
||||
|
||||
def parameter(self, key, default=None):
|
||||
value = default
|
||||
|
||||
|
|
|
@ -162,6 +162,8 @@ class i3(object):
|
|||
if widget.module() and self.__config.autohide(widget.module().name()):
|
||||
if not any(state in widget.state() for state in [ 'warning', 'critical']):
|
||||
continue
|
||||
if module.hidden():
|
||||
continue
|
||||
blocks.extend(self.__separator_block(module, widget))
|
||||
blocks.append(self.__content_block(module, widget))
|
||||
core.event.trigger('next-widget')
|
||||
|
|
Loading…
Reference in a new issue