[themes] Add support for generic warning/critical colors

Font and background colors for warning and critical elements can now be
specified using fg-warning, fg-critical, bg-warning and bg-critical.

Also, optionally, the "urgent" flag will be set towards the i3bar, if
possible.
This commit is contained in:
Tobias Witek 2016-10-31 11:35:12 +01:00
parent 6278a4e564
commit 14bce293eb
5 changed files with 40 additions and 3 deletions

View file

@ -18,7 +18,15 @@ class Module(bumblebee.module.Module):
with open("/sys/class/power_supply/{}/status".format(self._battery)) as f:
self._status = f.read().strip()
if self._status == "Discharging":
return "discharging"
if self._capacity < 10:
return "discharging_critical"
if self._capacity < 25:
return "discharging_low"
if self._capacity < 50:
return "discharging_medium"
if self._capacity < 75:
return "discharging_high"
return "discharging_full"
else:
return "charging"
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4