summaryrefslogtreecommitdiff
path: root/avg_batt
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-04-26 12:55:25 +0200
committerPatrick Simianer <p@simianer.de>2015-04-26 12:55:25 +0200
commitdcecdf63051a981f582d326d8a1b72bfd9c6b9eb (patch)
tree286b0d9056eb1412e429b654eea358d7c7283e18 /avg_batt
parent7047583d560c5ac2da71b0637ea7b98c187c33b2 (diff)
avg_batt: finally, awk works
Diffstat (limited to 'avg_batt')
-rwxr-xr-xavg_batt2
1 files changed, 1 insertions, 1 deletions
diff --git a/avg_batt b/avg_batt
index e7afeee..9fd528f 100755
--- a/avg_batt
+++ b/avg_batt
@@ -1,4 +1,4 @@
#!/bin/sh
-echo "$(acpi | cut -d' ' -f4|sed 's|%||'|avg|round 0)%"
+echo "$(acpi | cut -d ' ' -f 4 | sed 's|[%,]||g' | awk '{ total += $1; count++ } END { print total/count }')%"