From dcecdf63051a981f582d326d8a1b72bfd9c6b9eb Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 26 Apr 2015 12:55:25 +0200 Subject: avg_batt: finally, awk works --- avg_batt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'avg_batt') 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 }')%" -- cgit v1.2.3