From 88cd0d91863c65f5007da7e06a6fb78b74b050bb Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 24 Dec 2024 12:17:13 +0100 Subject: bar update --- .local/bin/status/sb-cpu | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.local/bin/status/sb-cpu') diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu index e85f422..f6eaa92 100755 --- a/.local/bin/status/sb-cpu +++ b/.local/bin/status/sb-cpu @@ -7,12 +7,14 @@ # ncpu=$(sysctl -n hw.ncpu | tee $ncpu_file) # fi -printf " " +printf "^c#8ec07c^ " # for i in $(top -P -d 2 -s 0.2 | grep '^CPU' | tail -n$ncpu | sed '{s/% idle$//;s/.*[[:blank:]]//;s/\..*//;s/^/100 - /;}' | bc); do case $(hostname -s) in mother|po-rbo) stats=$(uptime | head -n1) - printf "%s" "$(echo "$stats" | sed 's/.*average: *//;s/,.*//')" + top -b -d 0.1 -n 1 | grep "Cpu(s)" | \ + sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | \ + awk '{print int(100 - $1)"%"}' return ;; mars) -- cgit v1.2.3