From 7cb34cc99eef6dbb0d797ed9431d5ab97c30343a Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Sun, 7 Jun 2026 06:02:04 -0500 Subject: Changed the way GPU clock is handled. This jawn is not agnostic at all. --- sb-gpu | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sb-gpu') 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 -- cgit v1.2.3