2017-03-04 22:31:11 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-12-29 21:15:03 +00:00
|
|
|
|
|
|
|
status=$(acpi | awk '{orint $3;}' | sed 's/,//g')
|
2016-12-16 21:06:16 +00:00
|
|
|
capacity=$(acpi | awk '{print $4;}' | sed 's/%//g' | sed 's/,//g')
|
2016-12-29 21:15:03 +00:00
|
|
|
color=true
|
|
|
|
sparks=$(spark 0 $capacity 100)
|
|
|
|
|
2016-12-11 23:43:09 +00:00
|
|
|
echo -n "%{F#e5c078}"
|
|
|
|
if [[ $status == "Charging" ]]; then
|
|
|
|
echo -en "\uf0e7"
|
|
|
|
elif [[ $capacity -ge "85" ]]; then
|
|
|
|
echo -en "\uf240"
|
|
|
|
elif [[ $capacity -ge "65" ]]; then
|
|
|
|
echo -en "\uf241"
|
|
|
|
elif [[ $capacity -ge "45" ]]; then
|
|
|
|
echo -en "\uf242"
|
|
|
|
elif [[ $capacity -ge "15" ]]; then
|
|
|
|
echo -en "\uf243"
|
|
|
|
elif [[ $capacity -ge "0" ]]; then
|
|
|
|
color=true
|
|
|
|
echo -en "%{F#cc6666}\uf244"
|
|
|
|
fi
|
|
|
|
echo -n "%{F-}"
|
|
|
|
|
2016-12-29 21:15:03 +00:00
|
|
|
echo -n "Bat: $capacity% [${sparks:1:1}]"
|
2016-12-11 23:43:09 +00:00
|
|
|
|
|
|
|
if [[ color ]]; then
|
|
|
|
echo "%{F-}"
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
fi
|