[contrib/progress] allow hiding of inactive state

Add a new "hide-able" state "mayhide" that can be utilized by modules
without warning state. This state indicates that the module *may* be
hidden by autohide, if the user configures it like this.

see #835
This commit is contained in:
tobi-wan-kenobi 2021-11-05 14:00:34 +01:00
parent f0ab3ef03a
commit cbd989309d
2 changed files with 2 additions and 2 deletions

View file

@ -229,7 +229,7 @@ class i3(object):
for widget in module.widgets():
if widget.module and self.__config.autohide(widget.module.name):
if not any(
state in widget.state() for state in ["warning", "critical"]
state in widget.state() for state in ["warning", "critical", "mayhide"]
):
continue
if module.hidden():

View file

@ -102,7 +102,7 @@ class Module(core.module.Module):
def state(self, widget):
if self.__active:
return "copying"
return "pending"
return ["pending", "mayhide"]
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4