commit 8f5c353ef968bb7c834dab2c5292167f7d45c1c6
parent 4de8dd711de2e7a2f43108b3c3824306b4f3d187
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 19 Feb 2019 08:26:37 +0100
Remove emoji from battery status module
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/links/.config/i3/i3blocks b/links/.config/i3/i3blocks
@@ -92,7 +92,7 @@ interval=20
signal=10
[i3battery BAT0]
-label=PWR
+label=
interval=10
signal=12
diff --git a/links/.config/i3/i3scripts/i3battery b/links/.config/i3/i3scripts/i3battery
@@ -18,6 +18,7 @@ time=" ($(acpi -b | egrep -o '[0-9][0-9]:[0-9][0-9]'))"
powerdraw=" $(( $(cat /sys/class/power_supply/"$1"/power_now)/1000000 ))W"
[[ "$powerdraw" = " 0W" ]] && powerdraw=""
+warn=" "
if [ "$capacity" -ge 80 ]; then
color="#b8bb26"
elif [ "$capacity" -ge 60 ]; then
@@ -28,11 +29,12 @@ elif [ "$capacity" -ge 20 ]; then
color="#fe8019"
else
color="#fb4934"
- warn="❗"
+ warn="!"
fi
-[ -z $warn ] && warn=" "
-
[ "$status" = "Charging" ] && color="#FFF"
-printf "<span color='%s'>%s%s%s</span>%s" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" "$time$powerdraw"
+printf "<span color='%s'>%s%s%s</span>%s" "$color" \
+ "$(echo "$status" | \
+ sed -e "s/,//g;s/Discharging/BAT/;s/Charging/PWR/;s/Unknown//;s/Full//;s/ 0*/ /g;s/ :/ /g")" \
+ "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" "$time$powerdraw"