From cbd989309d39db1c35c56b3c7884dc3c42a3f679 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Fri, 5 Nov 2021 14:00:34 +0100 Subject: [PATCH] [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 --- bumblebee_status/core/output.py | 2 +- bumblebee_status/modules/contrib/progress.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bumblebee_status/core/output.py b/bumblebee_status/core/output.py index 121df27..cf79f2f 100644 --- a/bumblebee_status/core/output.py +++ b/bumblebee_status/core/output.py @@ -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(): diff --git a/bumblebee_status/modules/contrib/progress.py b/bumblebee_status/modules/contrib/progress.py index a1938d2..e818197 100644 --- a/bumblebee_status/modules/contrib/progress.py +++ b/bumblebee_status/modules/contrib/progress.py @@ -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