From f6695c8e02a3781505cee3c7b0276dc734b371c3 Mon Sep 17 00:00:00 2001 From: Johannes Rothe Date: Wed, 19 Sep 2018 22:14:43 +0200 Subject: [PATCH] scripts: add really simple script for BAT avg --- scripts/battery.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 scripts/battery.sh diff --git a/scripts/battery.sh b/scripts/battery.sh new file mode 100755 index 0000000..33cdb68 --- /dev/null +++ b/scripts/battery.sh @@ -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))%