diff --git a/i3pystatus/battery.py b/i3pystatus/battery.py index 2a88bf5..c62789b 100644 --- a/i3pystatus/battery.py +++ b/i3pystatus/battery.py @@ -115,6 +115,8 @@ class BatteryChecker(IntervalModule): ("alert_format_body", "The body text of the notification, all formatters can be used"), ("path", "Override the default-generated path"), ("status", "A dictionary mapping ('DIS', 'CHR', 'FULL') to alternative names"), + ("color", "The text color"), + ("critical_color", "The critical color"), ) battery_ident = "BAT0" format = "{status} {remaining}" @@ -128,6 +130,8 @@ class BatteryChecker(IntervalModule): alert_percentage = 10 alert_format_title = "Low battery" alert_format_body = "Battery {battery_ident} has only {percentage:.2f}% ({remaining:%E%hh:%Mm}) remaining!" + color = "#ffffff" + critical_color = "#ff0000" path = None @@ -138,7 +142,7 @@ class BatteryChecker(IntervalModule): def run(self): urgent = False - color = "#ffffff" + color = self.color battery = Battery.create(self.path) @@ -158,7 +162,7 @@ class BatteryChecker(IntervalModule): fdict["status"] = "DIS" if battery.percentage() <= self.alert_percentage: urgent = True - color = "#ff0000" + color = self.critical_color else: fdict["status"] = "CHR" else: @@ -179,5 +183,5 @@ class BatteryChecker(IntervalModule): "full_text": formatp(self.format, **fdict).strip(), "instance": self.battery_ident, "urgent": urgent, - "color": color + "color": color, } diff --git a/i3pystatus/load.py b/i3pystatus/load.py index 7fcf1c4..335bd92 100644 --- a/i3pystatus/load.py +++ b/i3pystatus/load.py @@ -11,6 +11,8 @@ class Load(IntervalModule): settings = ( ("format", "format string used for output. {avg1}, {avg5} and {avg15} are the load average of the last one, five and fifteen minutes, respectively. {tasks} is the number of tasks (i.e. 1/285, which indiciates that one out of 285 total tasks is runnable)."), + ("critical_limit", "Limit under witch one the battery is critical"), + ("critical_color", "The critical color"), ) file = "/proc/loadavg"