diff options
| author | Joshua Drake <joshua.ellis.drake@gmail.com> | 2026-06-07 06:02:04 -0500 |
|---|---|---|
| committer | Joshua Drake <joshua.ellis.drake@gmail.com> | 2026-06-07 06:02:04 -0500 |
| commit | 7cb34cc99eef6dbb0d797ed9431d5ab97c30343a (patch) | |
| tree | f3ccfd15add1a5a5b15344ef5e33d65409d231ca | |
| parent | 1da1b72c557e24d4d225cebb32af3592b1e4a7df (diff) | |
| -rwxr-xr-x | sb-gpu | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |
