From 99bd2a81b6c4a27dc15d5bd6ad1cabb2d11669fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20L=C3=BCftinger?= Date: Wed, 15 Mar 2023 19:01:48 +0100 Subject: [PATCH] remove unnecessary playerctl calls to determine whether widgets should be hidden --- bumblebee_status/modules/contrib/playerctl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) mode change 100755 => 100644 bumblebee_status/modules/contrib/playerctl.py diff --git a/bumblebee_status/modules/contrib/playerctl.py b/bumblebee_status/modules/contrib/playerctl.py old mode 100755 new mode 100644 index bd8876c..c405a0e --- a/bumblebee_status/modules/contrib/playerctl.py +++ b/bumblebee_status/modules/contrib/playerctl.py @@ -34,6 +34,7 @@ class Module(core.module.Module): self.background = True self.__hide = util.format.asbool(self.parameter("hide", "false")); + self.__hidden = self.__hide self.__layout = util.format.aslist( self.parameter( @@ -87,7 +88,7 @@ class Module(core.module.Module): core.input.register(widget, **callback_options) def hidden(self): - return self.__hide and self.status() == None + return self.__hidden def status(self): try: @@ -101,6 +102,10 @@ class Module(core.module.Module): def update(self): playback_status = self.status() + if not playback_status: + self.__hidden = self.__hide + else: + self.__hidden = False for widget in self.widgets(): if playback_status: if widget.name == "playerctl.pause":