From a190993b0579dfaacd5fe75a49fcb3214e2cb1bf Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 2 Oct 2025 11:14:43 +0200 Subject: up --- .local/bin/status/sb-cpu | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100755 .local/bin/status/sb-cpu (limited to '.local/bin/status/sb-cpu') diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu deleted file mode 100755 index fe3712a..0000000 --- a/.local/bin/status/sb-cpu +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# ncpu_file="/tmp/ncpu" -# if [ -f $ncpu_file ]; then -# ncpu=$(cat $ncpu_file) -# else -# ncpu=$(sysctl -n hw.ncpu | tee $ncpu_file) -# fi - -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) - top -b -d 0.1 -n 1 | grep "Cpu(s)" | \ - sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | \ - awk '{print int(100 - $1)"%"}' - exit - ;; - mars) - stats=$(top -d 2 -s 0.2 | grep -E 'load averages:|^CPU') - printf "%s " "$(echo "$stats" | sed '{1,2d;4d;s/.*averages: *//;s/,.*//;}')" - ;; -esac - -case $(echo "$stats" | sed '{1,3d;s/% idle$//;s/.*[[:blank:]]//;s/\..*//;s/^/(100 - /;s/$/) \/ 12\.5/;}' | bc) in - "0") printf "[ ]\n" ;; - "1") printf "[= ]\n" ;; - "2") printf "[== ]\n" ;; - "3") printf "[=== ]\n" ;; - "4") printf "[==== ]\n" ;; - "5") printf "[===== ]\n" ;; - "6") printf "[====== ]\n" ;; - "7") printf "[======= ]\n" ;; - "8") printf "[========]\n" ;; -esac - -- cgit v1.2.3