summaryrefslogtreecommitdiff
path: root/bin/st-usage
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
commit7b21727285e50b0b050c4ddd70d07542229c5366 (patch)
tree5d369153c5df5b41f3750d25479a68f20169c8ff /bin/st-usage
init
Diffstat (limited to 'bin/st-usage')
-rwxr-xr-xbin/st-usage4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/st-usage b/bin/st-usage
new file mode 100755
index 0000000..c49a20f
--- /dev/null
+++ b/bin/st-usage
@@ -0,0 +1,4 @@
+#!/bin/sh
+CPU_USAGE=$(top -bn2 | grep "%Cpu(s)" | awk 'NR==2 {print 100 - $8}')
+GPU_USAGE=$(nvtop -s | grep gpu_util | awk '{print $2}' | sed 's/"//g;s/,//')
+echo "CPU:$CPU_USAGE% GPU:$GPU_USAGE"