summary refs log tree commit diff
diff options
context:
space:
mode:
authorDruid520 <r.ustydruid520@proton.me>2026-08-12 11:30:58 -0700
committerDruid520 <r.ustydruid520@proton.me>2026-08-12 11:30:58 -0700
commitc5b3a8e72188ba009a8361d6bb6c9a2f976ef4ab (patch)
treec3dee925703b50adeaa6d6e56aa4900a562b0e3b
parenta8931e37deb494d4908a720b6cdc9cbd0d7779d3 (diff)
ADD: cpu usage (mpstat)
-rwxr-xr-xsif.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/sif.sh b/sif.sh index 4be8315..be1b6cf 100755 --- a/sif.sh +++ b/sif.sh
@@ -9,6 +9,7 @@ OS=$(cat /etc/os-release | grep "^PRETTY_NAME" | cut -d'"' -f2)
9KERN=$(uname -r) 9KERN=$(uname -r)
10TDSK=$(df -m / | awk 'NR==2{print $2}') 10TDSK=$(df -m / | awk 'NR==2{print $2}')
11UDSK=$(df -m / | awk 'NR==2{print $3}') 11UDSK=$(df -m / | awk 'NR==2{print $3}')
12UCPU=$(mpstat 1 1 | awk '/all/ {print 100 - $NF"%"}' | tail -n1) # requires mpstat
12 13
13if [ "$1" = "-h" ]; then 14if [ "$1" = "-h" ]; then
14 cat <<EOF 15 cat <<EOF
@@ -26,7 +27,7 @@ fi
26if [ "$1" = "-v" ]; then 27if [ "$1" = "-v" ]; then
27 cat <<EOF 28 cat <<EOF
28ver: 1.0. 29ver: 1.0.
29license: gpl-3.0-or-later. 30license: GPL-3.0-or-later.
30EOF 31EOF
31 exit 0 32 exit 0
32fi 33fi
@@ -66,7 +67,7 @@ echo "pkgs: ${PKGC} (${PKGM})."
66echo "editor: ${EDITOR}." 67echo "editor: ${EDITOR}."
67echo "de/wm: ${XDG_CURRENT_DESKTOP:-$DESKTOP_SESSION}." 68echo "de/wm: ${XDG_CURRENT_DESKTOP:-$DESKTOP_SESSION}."
68echo "term: ${TERM}." 69echo "term: ${TERM}."
69echo "cpu: ${CPU}." 70echo "cpu: ${CPU} ${UCPU}."
70echo "gpu: ${GPU}." 71echo "gpu: ${GPU}."
71echo "mem: ${UMEM}MiB/${TMEM}MiB." 72echo "mem: ${UMEM}MiB/${TMEM}MiB."
72echo "disk: ${UDSK}MiB/${TDSK}MiB." 73echo "disk: ${UDSK}MiB/${TDSK}MiB."