summaryrefslogtreecommitdiffstats
path: root/.local/bin/status/sb-cpu
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/status/sb-cpu')
-rwxr-xr-x.local/bin/status/sb-cpu6
1 files changed, 4 insertions, 2 deletions
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)