From 26e4bdd7eb9fd8c8509693cd7d061e065c4f348f Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Sat, 6 Nov 2021 08:21:08 +0100 Subject: [PATCH] [modules/progress] improved autohide functionality Simplify the previous autohide functionality by adding a flag that lets a module (e.g. progress) indicate that the current state should be "revealed" (not auto-hidden). This vastly simplifies the implementation. 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..cee579f 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", "no-autohide"] ): continue if module.hidden(): diff --git a/bumblebee_status/modules/contrib/progress.py b/bumblebee_status/modules/contrib/progress.py index a1938d2..7e148b3 100644 --- a/bumblebee_status/modules/contrib/progress.py +++ b/bumblebee_status/modules/contrib/progress.py @@ -101,7 +101,7 @@ class Module(core.module.Module): def state(self, widget): if self.__active: - return "copying" + return ["copying", "no-autohide"] return "pending"