commit 6b1646d1cd224077f607d1a17d0486bdbd64fe82
parent 9a0a91fd6e6f7ac15351b78c98faf643fc60adae
Author: oscarbenedito <oscar@oscarbenedito.com>
Date: Sat, 25 Apr 2020 17:01:38 +0200
Battery status isn't colored (except for really low)
Diffstat:
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/dot_config/i3blocks/bin/executable_battery2 b/dot_config/i3blocks/bin/executable_battery2
@@ -12,7 +12,7 @@ status = check_output(['acpi'], universal_newlines=True)
if not status:
# stands for no battery found
- fulltext = "<span color='red'><span font='FontAwesome'>\uf00d \uf240</span></span>"
+ fulltext = "<span font='FontAwesome'>\uf00d \uf240</span>"
percentleft = 100
else:
# if there is more than one battery in one laptop, the percentage left is
@@ -49,7 +49,7 @@ else:
percentleft = 0
# stands for charging
- FA_LIGHTNING = "<span color='yellow'><span font='FontAwesome'>\uf0e7</span></span>"
+ FA_LIGHTNING = "<span font='FontAwesome'>\uf0e7</span>"
# stands for plugged in
FA_PLUG = "<span font='FontAwesome'>\uf1e6</span>"
@@ -70,7 +70,7 @@ else:
fulltext = FA_QUESTION + " " + FA_BATTERY + " "
timeleft = ""
else:
- fulltext = FA_LIGHTNING + " " + FA_PLUG + " "
+ fulltext = FA_LIGHTNING + " "
def color(percent):
if percent < 10:
@@ -79,17 +79,7 @@ else:
if percent < 20:
return "#FF3300"
if percent < 30:
- return "#FF6600"
- if percent < 40:
- return "#FF9900"
- if percent < 50:
- return "#FFCC00"
- if percent < 60:
return "#FFFF00"
- if percent < 70:
- return "#FFFF33"
- if percent < 80:
- return "#FFFF66"
return "#FFFFFF"
form = '<span color="{}">{}%</span>'