From 9555aadb15412b659da78060600d0a724a975bd2 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 18 Aug 2022 10:46:30 +0200 Subject: added disks --- .local/bin/status/sb-cpu | 2 +- .local/bin/status/sb-disk | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 .local/bin/status/sb-disk (limited to '.local') diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu index 3b68cf4..8ad6dfb 100755 --- a/.local/bin/status/sb-cpu +++ b/.local/bin/status/sb-cpu @@ -7,7 +7,7 @@ else ncpu=$(sysctl -n hw.ncpu | tee $ncpu_file) fi -printf " " +printf " " # for i in $(top -P -d 1 | sed -n 3,${topline}p | rev | cut -d' ' -f2 | rev | cut -d'.' -f1 | awk '{print (100 - $1)}'); do 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 $(echo $i / 12.5 | bc) in diff --git a/.local/bin/status/sb-disk b/.local/bin/status/sb-disk new file mode 100755 index 0000000..2e19c3b --- /dev/null +++ b/.local/bin/status/sb-disk @@ -0,0 +1,9 @@ +#!/bin/sh + +echo -n " " +df=$(df -h -T | grep '/$') +if echo "$df" | grep zfs >/dev/null 2>&1; then + zpool list | tail -n1 | awk '{print $8" - "$3"/"$2}' +else + echo "$df" | awk '{print $6" - "$4"/"$3}' +fi -- cgit v1.2.3