summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Drake <joshua.ellis.drake@gmail.com>2026-06-07 06:02:04 -0500
committerJoshua Drake <joshua.ellis.drake@gmail.com>2026-06-07 06:02:04 -0500
commit7cb34cc99eef6dbb0d797ed9431d5ab97c30343a (patch)
treef3ccfd15add1a5a5b15344ef5e33d65409d231ca
parent1da1b72c557e24d4d225cebb32af3592b1e4a7df (diff)
Changed the way GPU clock is handled. This jawn is not agnostic at all.HEADmaster
-rwxr-xr-xsb-gpu8
1 files changed, 5 insertions, 3 deletions
diff --git a/sb-gpu b/sb-gpu
index dfd24d7..a43bd3b 100755
--- a/sb-gpu
+++ b/sb-gpu
@@ -1,13 +1,15 @@
#!/bin/sh
lspci -k | grep -q "VGA compatible controller: NVIDIA" && NVIDIACard=1
getGPUClock() {
- sed -n "s/[0-9]: //g;/*/ {s/\s.*//; p}" /sys/class/drm/card1/device/pp_dpm_sclk
+# sed -n "s/[0-9]: //g;/*/ {s/\s.*//; p}" /sys/class/drm/card1/device/pp_dpm_sclk
+ GPUClock=$(cat /sys/class/drm/card1/device/hwmon/hwmon*/freq1_input)
+ numfmt --to=iec $GPUClock --format %1.1f
}
getGPUBusy() {
cat /sys/class/drm/card1/device/gpu_busy_percent
}
getGPUTemperature() {
- sed "s/000//" /sys/class/drm/card1/device/hwmon/hwmon1/temp1_input
+ sed "s/000//" /sys/class/drm/card1/device/hwmon/hwmon*/temp1_input
}
getGPUVRAM() {
usedRAM=$(cat /sys/class/drm/card1/device/mem_info_vram_used)
@@ -29,5 +31,5 @@ if [ "$NVIDIACard" ]
then
printf "%s\n" "$(getNVIDIA)"
else
-printf "%s %s %s%% 🌡️%s°\n" "$(getGPUClock)" "$(getGPUVRAM)" "$(getGPUBusy)" "$(getGPUTemperature)"
+printf "%s %s %s%% 🌡️%s°\n" "$(getGPUClock)Hz" "$(getGPUVRAM)" "$(getGPUBusy)" "$(getGPUTemperature)"
fi