summaryrefslogtreecommitdiff
path: root/bin/st-usage
diff options
context:
space:
mode:
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"