From 85bcc7164fa94d9d4cac98608f3b29b7de91be64 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 1 Nov 2018 21:58:07 +0100 Subject: [PATCH 1/5] Fixed status for unknown charge state --- bumblebee/modules/battery.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bumblebee/modules/battery.py b/bumblebee/modules/battery.py index 5367d5f..bd10efe 100644 --- a/bumblebee/modules/battery.py +++ b/bumblebee/modules/battery.py @@ -112,6 +112,8 @@ class Module(bumblebee.engine.Module): pass if charge == "Discharging": state.append("discharging-{}".format(min([10, 25, 50, 80, 100], key=lambda i: abs(i-capacity)))) + elif charge == "Unknown": + state.append("unknown") else: if capacity > 95: state.append("charged") From 19e6abc8ca61ba0b0ad7ea92001fe32c566b1f2a Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 1 Nov 2018 22:15:00 +0100 Subject: [PATCH 2/5] Added option to disable city display --- bumblebee/modules/weather.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/weather.py b/bumblebee/modules/weather.py index 00c5873..eaf81a1 100644 --- a/bumblebee/modules/weather.py +++ b/bumblebee/modules/weather.py @@ -33,6 +33,7 @@ class Module(bumblebee.engine.Module): self._location = self.parameter("location", "auto") self._city = self.parameter("location", "") self._unit = self.parameter("unit", "metric") + self._showcity = self.parameter("showcity", "true") self._valid = False self.interval(15) @@ -55,7 +56,10 @@ class Module(bumblebee.engine.Module): def output(self, widget): if not self._valid: return u"?" - return self.city() + self.temperature() + if self._showcity == "false": + return self.temperature() + else: + return self.city() + self.temperature() def state(self, widget): if self._valid: From 6de12a0e96f7ed6c4b596b4333447198e6efffd3 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 2 Nov 2018 00:52:04 +0100 Subject: [PATCH 3/5] Added support for date time click --- bumblebee/modules/datetime.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bumblebee/modules/datetime.py b/bumblebee/modules/datetime.py index 14c2d67..9e42f84 100644 --- a/bumblebee/modules/datetime.py +++ b/bumblebee/modules/datetime.py @@ -30,6 +30,9 @@ class Module(bumblebee.engine.Module): def __init__(self, engine, config): super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.get_time)) + self._app = self.parameter("open", "calendar") + engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, + cmd=self._app) self._fmt = self.parameter("format", default_format(self.name)) l = locale.getdefaultlocale() if not l or l == (None, None): From f021250e418aa98f6188834f1125600fe74a3062 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 2 Nov 2018 10:04:43 +0100 Subject: [PATCH 4/5] Using util function for boolean param --- bumblebee/modules/weather.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bumblebee/modules/weather.py b/bumblebee/modules/weather.py index eaf81a1..8676fc0 100644 --- a/bumblebee/modules/weather.py +++ b/bumblebee/modules/weather.py @@ -32,8 +32,8 @@ class Module(bumblebee.engine.Module): self._apikey = self.parameter("apikey", "af7bfe22287c652d032a3064ffa44088") self._location = self.parameter("location", "auto") self._city = self.parameter("location", "") + self._showcity = bumblebee.util.asbool(self.parameter("showcity", True)) self._unit = self.parameter("unit", "metric") - self._showcity = self.parameter("showcity", "true") self._valid = False self.interval(15) @@ -56,10 +56,10 @@ class Module(bumblebee.engine.Module): def output(self, widget): if not self._valid: return u"?" - if self._showcity == "false": - return self.temperature() - else: + if self._showcity: return self.city() + self.temperature() + else: + return self.temperature() def state(self, widget): if self._valid: From a2804e92f68f9bd152499df4e753b4b9dfb5990e Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 3 Nov 2018 17:38:39 +0100 Subject: [PATCH 5/5] Removed open parameter --- bumblebee/modules/datetime.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bumblebee/modules/datetime.py b/bumblebee/modules/datetime.py index 9e42f84..02f71b9 100644 --- a/bumblebee/modules/datetime.py +++ b/bumblebee/modules/datetime.py @@ -30,7 +30,6 @@ class Module(bumblebee.engine.Module): def __init__(self, engine, config): super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.get_time)) - self._app = self.parameter("open", "calendar") engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, cmd=self._app) self._fmt = self.parameter("format", default_format(self.name))