From 96936946fa8b803d90674b59f6d195613e7af60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= Date: Thu, 23 Feb 2017 13:51:35 +0100 Subject: [PATCH 1/2] core/desktop: Use default server timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- i3pystatus/core/desktop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3pystatus/core/desktop.py b/i3pystatus/core/desktop.py index d01161f..8e8eb74 100644 --- a/i3pystatus/core/desktop.py +++ b/i3pystatus/core/desktop.py @@ -13,7 +13,7 @@ class BaseDesktopNotification: """ def __init__(self, title, body, icon="dialog-information", urgency=1, - timeout=0, log_level=logging.WARNING): + timeout=-1, log_level=logging.WARNING): self.title = title self.body = body self.icon = icon From 123516fe549801e4331dcd676759e8cd81a6bbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= Date: Thu, 23 Feb 2017 13:52:57 +0100 Subject: [PATCH 2/2] battery: Make alert timeout configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #549. Signed-off-by: Johannes Löthberg --- i3pystatus/battery.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/i3pystatus/battery.py b/i3pystatus/battery.py index 5071602..c45ec76 100644 --- a/i3pystatus/battery.py +++ b/i3pystatus/battery.py @@ -174,6 +174,7 @@ class BatteryChecker(IntervalModule): ("critical_level_command", "Runs a shell command in the case of a critical power state"), "critical_level_percentage", "alert_percentage", + "alert_timeout", ("alert_format_title", "The title of the notification, all formatters can be used"), ("alert_format_body", "The body text of the notification, all formatters can be used"), ("path", "Override the default-generated path and specify the full path for a single battery"), @@ -203,6 +204,7 @@ class BatteryChecker(IntervalModule): critical_level_command = "" critical_level_percentage = 1 alert_percentage = 10 + alert_timeout = -1 alert_format_title = "Low battery" alert_format_body = "Battery {battery_ident} has only {percentage:.2f}% ({remaining:%E%hh:%Mm}) remaining!" color = "#ffffff" @@ -339,7 +341,7 @@ class BatteryChecker(IntervalModule): body=formatp(self.alert_format_body, **fdict), icon="battery-caution", urgency=2, - timeout=60, + timeout=self.alert_timeout, ).display() fdict["status"] = self.status[fdict["status"]]