From 40991f3809cdb3c39c3806d7eb6489c1f30d64de Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Tue, 7 Nov 2023 17:07:16 -0600 Subject: inital commit --- sb-gpu | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 sb-gpu (limited to 'sb-gpu') 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)" -- cgit v1.2.3