This commit is contained in:
Marcin Wozniak
2019-10-23 21:07:02 +02:00
parent 6e03958841
commit 6cda9bba33
4 changed files with 26 additions and 15 deletions

View File

@ -15,7 +15,7 @@ dunst -config&
/usr/bin/ibus-daemon -d&
transmission-daemon&
#pl&
(sleep 30 && getforecast)&
#(sleep 30 && getforecast)&
print_torrent(){
@ -81,18 +81,19 @@ batLevel() {
hash acpi || return 0
onl="$(acpi -V | grep "on-line")"
charge="$(cat /sys/class/power_supply/BAT*/capacity)"
time="$(awk '{print $5}' <(acpi))"
# Determine battery glyph by percentage range
if [[ -z $onl && ${charge} -gt 80 ]]; then
echo -e " ${charge}%"
echo -e " ${charge}% ${time}"
elif [[ -z $onl && ${charge} -le 80 && ${charge} -gt 60 ]]; then
echo -e " ${charge}%"
echo -e " ${charge}% ${time}"
elif [[ -z $onl && ${charge} -le 60 && ${charge} -gt 40 ]]; then
echo -e " ${charge}%"
echo -e " ${charge}% ${time}"
elif [[ -z $onl && ${charge} -le 40 && ${charge} -gt 20 ]]; then
echo -e " ${charge}%"
echo -e " ${charge}% ${time}"
elif [[ -z $onl && ${charge} -le 20 ]]; then
echo -e " ${charge}%"
echo -e " ${charge}% ${time}"
# If charging, use animated glyph
else
echo -e ""