From ab36aee3c2343085db7c60f7d6fd01d22f723713 Mon Sep 17 00:00:00 2001 From: Josef Gajdusek Date: Sun, 6 Jul 2014 14:53:50 +0200 Subject: [PATCH] Add charging_color and full_color parameters to the battery module --- i3pystatus/battery.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/i3pystatus/battery.py b/i3pystatus/battery.py index 9874246..4e391f7 100644 --- a/i3pystatus/battery.py +++ b/i3pystatus/battery.py @@ -125,6 +125,8 @@ class BatteryChecker(IntervalModule): ("path", "Override the default-generated path"), ("status", "A dictionary mapping ('DIS', 'CHR', 'FULL') to alternative names"), ("color", "The text color"), + ("full_color", "The full color"), + ("charging_color", "The charging color"), ("critical_color", "The critical color"), ) battery_ident = "BAT0" @@ -140,6 +142,8 @@ class BatteryChecker(IntervalModule): alert_format_title = "Low battery" alert_format_body = "Battery {battery_ident} has only {percentage:.2f}% ({remaining:%E%hh:%Mm}) remaining!" color = "#ffffff" + full_color = "#11aa11" + charging_color = "#00ff00" critical_color = "#ff0000" path = None @@ -174,8 +178,10 @@ class BatteryChecker(IntervalModule): color = self.critical_color else: fdict["status"] = "CHR" + color = self.charging_color else: fdict["status"] = "FULL" + color = self.full_color if self.alert and fdict["status"] == "DIS" and fdict["percentage"] <= self.alert_percentage: DesktopNotification(