scripts: add really simple script for BAT avg

This commit is contained in:
Johannes Rothe 2018-09-19 22:14:43 +02:00
parent 1810914530
commit f6695c8e02

3
scripts/battery.sh Executable file
View File

@ -0,0 +1,3 @@
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))%