all repos — dotfiles @ 415ca287a1f9ce1329d40122cf7656ef8a7f130b

linux dotfiles

i3blocks/battery

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh
percent=$(acpi | cut -d ' ' -f4 | tail -1 |  tr -d ',')
state=$(acpi | cut -d ' ' -f3 | tail -1 | tr -d ',')

case $state in
    Charging)
        symbol="<span font='Font Awesome 5 Free 9'>\uf0e7 </span>"
        ;;
    *)
        #symbol="<span font='Icons 11'>\uf213</span>"
        #symbol="<span font='Material Design Icons'>\uf079</span>"
        ;;
esac

echo -e "$symbol$percent"