summaryrefslogtreecommitdiff
path: root/sb-gpu
diff options
context:
space:
mode:
Diffstat (limited to 'sb-gpu')
-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)"