dotfiles/scripts/battery.sh

4 lines
132 B
Bash
Raw Normal View History

count=$(acpi -b | wc -l)
sum=$(acpi -b | grep -Eo '[0-9]{1,3}%' | tr -d '%' | xargs | sed -e 's/ /+/g' | bc)
echo $((sum / count))%