battery: Use alert_percentage for coloring the entry red
This commit is contained in:
parent
ff32f74bec
commit
98ba2e69da
@ -145,12 +145,12 @@ class BatteryChecker(IntervalModule):
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = battery.status()
|
status = battery.status()
|
||||||
if status in ["Discharging", "Charging"]:
|
if status in ["Charging", "Discharging"]:
|
||||||
remaining = battery.remaining()
|
remaining = battery.remaining()
|
||||||
fdict["remaining"] = TimeWrapper(remaining * 60, "%E%h:%M")
|
fdict["remaining"] = TimeWrapper(remaining * 60, "%E%h:%M")
|
||||||
if status == "Discharging":
|
if status == "Discharging":
|
||||||
fdict["status"] = "DIS"
|
fdict["status"] = "DIS"
|
||||||
if remaining < 15:
|
if battery.percentage() <= self.alert_percentage:
|
||||||
urgent = True
|
urgent = True
|
||||||
color = "#ff0000"
|
color = "#ff0000"
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user