dotfiles/scripts/battery.sh
2018-09-19 22:14:43 +02:00

4 lines
132 B
Bash
Executable File

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))%