summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Drake <joshua.ellis.drake@gmail.com>2023-11-07 17:07:16 -0600
committerJoshua Drake <joshua.ellis.drake@gmail.com>2023-11-07 17:07:16 -0600
commit40991f3809cdb3c39c3806d7eb6489c1f30d64de (patch)
tree7ddbb86722450c1ff594d7f5364b0d3fb68c3419
inital commit
-rwxr-xr-xsb-gpu21
1 files changed, 21 insertions, 0 deletions
diff --git a/sb-gpu b/sb-gpu
new file mode 100755
index 0000000..45dec9d
--- /dev/null
+++ b/sb-gpu
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+getGPUClock() {
+ echo "$GPUClock" | sed -n "s/[0-9]: //g;/*/ {s/\s.*//; p}" /sys/class/drm/card1/device/pp_dpm_sclk
+}
+getGPUBusy() {
+ echo "$GPUBusy" | cat /sys/class/drm/card1/device/gpu_busy_percent
+}
+getGPUTemperature() {
+ echo "$GPUTemp" | grep -o "[0-9]\{2\}" /sys/class/drm/card1/device/hwmon/hwmon1/temp1_input | head -1
+}
+
+case $BLOCK_BUTTON in
+ #1) notify-send "RadeonTop" "$(radeontop)" ;;
+ 2) setsid -f "$TERMINAL" -e radeontop ;;
+ 3) notify-send "GPU Module" "\- Shows graphics core utilization.
+- Middle Click to show RadeonTop." ;;
+ 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
+esac
+
+printf "%s %s%% 🌡️%s°\n" "$(getGPUClock)" "$(getGPUBusy)" "$(getGPUTemperature)"