From 45d893aababfd6909007d0cd5eb16f8015158d1c Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 7 May 2020 06:18:17 +0200 Subject: [PATCH 1/3] improved smartstatus --- modules/contrib/smartstatus.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/contrib/smartstatus.py b/modules/contrib/smartstatus.py index a403eeb..e730a9a 100644 --- a/modules/contrib/smartstatus.py +++ b/modules/contrib/smartstatus.py @@ -7,7 +7,8 @@ Parameters: * smartstatus.display: how to display (defaults to 'combined', other choices: 'seperate' or 'singles') - * smartstauts.drives: in the case of singles which drives to display, separated comma list value, multiple accepted (defaults to 'sda', example:'sda,sdc') + * smartstatus.drives: in the case of singles which drives to display, separated comma list value, multiple accepted (defaults to 'sda', example:'sda,sdc') + * smartstatus.shownames: boolean in the form of "True" or "False" to show the name of the drives in the form of sda, sbd, combined or none at all. """ import os @@ -29,6 +30,7 @@ class Module(core.module.Module): self.devices = self.list_devices() self.display = self.parameter("display", "combined") self.drives = self.parameter("drives", "sda") + self.show_names = self.parameter("show_names", "True") self.widgets(self.create_widgets()) def create_widgets(self): @@ -63,7 +65,10 @@ class Module(core.module.Module): def output(self, widget): device = widget.get("device") assessment = widget.get("assessment") - widget.full_text("{}: {}".format(device, assessment)) + if self.show_names == "False": + widget.full_text("{}".format(assessment)) + else: + widget.full_text("{}: {}".format(device, assessment)) def state(self, widget): states = [] From 478ee68f897381e47e52c00c3455e7c3e2f469dc Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 7 May 2020 06:44:27 +0200 Subject: [PATCH 2/3] Improved reshdift --- modules/core/redshift.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/redshift.py b/modules/core/redshift.py index bf1b94e..6948516 100644 --- a/modules/core/redshift.py +++ b/modules/core/redshift.py @@ -11,6 +11,7 @@ Parameters: 'auto' uses whatever redshift is configured to do * redshift.lat : latitude if location is set to 'manual' * redshift.lon : longitude if location is set to 'manual' + * redshift.transition_info: information about the transitions (x% day) defaults to True """ import re @@ -74,6 +75,7 @@ class Module(core.module.Module): super().__init__(config, theme, core.widget.Widget(self.text)) self.__thread = None + self.transition_info = self.parameter("transition_info", "True") if self.parameter("location", "") == "ipinfo": # override lon/lat with ipinfo @@ -91,7 +93,7 @@ class Module(core.module.Module): def text(self, widget): val = widget.get("temp", "n/a") transition = widget.get("transition", "") - if transition: + if transition and self.transition_info=="True": val = "{} {}".format(val, transition) return val From 879d00775b1f62b7e00ef320c8589f375cf5e78f Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 7 May 2020 07:06:27 +0200 Subject: [PATCH 3/3] Shorter off message for docker_ps --- modules/contrib/docker_ps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/contrib/docker_ps.py b/modules/contrib/docker_ps.py index 7ece29c..cb2a107 100644 --- a/modules/contrib/docker_ps.py +++ b/modules/contrib/docker_ps.py @@ -26,7 +26,7 @@ class Module(core.module.Module): state = [] if self.__info == "OK - 0": state.append("warning") - elif self.__info in ["n/a", "daemon off"]: + elif self.__info in ["n/a", "Off"]: state.append("critical") return state @@ -38,7 +38,7 @@ class Module(core.module.Module): len(cli.containers.list(filters={"status": "running"})) ) except ConnectionError: - self.__info = "daemon off" + self.__info = "Off" except Exception: self.__info = "n/a" return self.__info