summaryrefslogtreecommitdiffstats
path: root/.local/bin/status/sb-cpu
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-12-24 12:17:13 +0100
committerJoe <rbo@gmx.us>2024-12-24 12:17:13 +0100
commit88cd0d91863c65f5007da7e06a6fb78b74b050bb (patch)
tree75e9752229dc5ac8000eac4dc27efffe5adf54c7 /.local/bin/status/sb-cpu
parentup (diff)
downloaddotfiles-bsd-88cd0d91863c65f5007da7e06a6fb78b74b050bb.tar.gz
dotfiles-bsd-88cd0d91863c65f5007da7e06a6fb78b74b050bb.tar.bz2
dotfiles-bsd-88cd0d91863c65f5007da7e06a6fb78b74b050bb.tar.xz
dotfiles-bsd-88cd0d91863c65f5007da7e06a6fb78b74b050bb.tar.zst
dotfiles-bsd-88cd0d91863c65f5007da7e06a6fb78b74b050bb.zip
bar update
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)