summaryrefslogtreecommitdiffstats
path: root/.local/bin/status/sb-cpu
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-08-17 14:37:44 +0200
committerJoe <bousset.rudy@gmail.com>2022-08-17 14:37:44 +0200
commit9addbecbf31bab7088d3089a99964eeb3c6c7928 (patch)
treebfb42318b4495c88eb7883180661bf53cc9e0a8c /.local/bin/status/sb-cpu
parentupdate (diff)
downloaddotfiles-bsd-9addbecbf31bab7088d3089a99964eeb3c6c7928.tar.gz
dotfiles-bsd-9addbecbf31bab7088d3089a99964eeb3c6c7928.tar.bz2
dotfiles-bsd-9addbecbf31bab7088d3089a99964eeb3c6c7928.tar.xz
dotfiles-bsd-9addbecbf31bab7088d3089a99964eeb3c6c7928.tar.zst
dotfiles-bsd-9addbecbf31bab7088d3089a99964eeb3c6c7928.zip
update
Diffstat (limited to '')
-rwxr-xr-x.local/bin/status/sb-cpu27
1 files changed, 14 insertions, 13 deletions
diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu
index f6769a1..2504428 100755
--- a/.local/bin/status/sb-cpu
+++ b/.local/bin/status/sb-cpu
@@ -4,16 +4,17 @@ ncpu=$(sysctl -n hw.ncpu)
ncpu=$((ncpu - 1))
cpu=""
printf " "
-for i in $(seq 0 $ncpu); do
- case $(sysctl -n dev.cpu.$i.cx_usage | cut -d'.' -f1 | awk '{printf "%d\n", $1 / 12.5}') in
- "0") printf "▁";;
- "1") printf "▂";;
- "2") printf "▃";;
- "3") printf "▄";;
- "4") printf "▅";;
- "5") printf "▆";;
- "6") printf "▇";;
- "7") printf "█";;
- "8") printf "█";;
- esac;
-done
+w | head -n1 | awk '{print $8}' | cut -d',' -f1
+# for i in $(seq 0 $ncpu); do
+# case $(sysctl -n dev.cpu.$i.cx_usage | cut -d'.' -f1 | awk '{printf "%d\n", $1 / 12.5}') in
+# "0") printf "▁";;
+# "1") printf "▂";;
+# "2") printf "▃";;
+# "3") printf "▄";;
+# "4") printf "▅";;
+# "5") printf "▆";;
+# "6") printf "▇";;
+# "7") printf "█";;
+# "8") printf "█";;
+# esac;
+# done