From ea81343cdfeb6e9c09e1bf45a8ef0935459f15b5 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Fri, 10 Nov 2023 01:14:11 -0600 Subject: Consolidated deez VRAM Yamean? Word to your mother. -Dallas --- sb-gpu | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sb-gpu b/sb-gpu index 8e27da1..b0ab382 100755 --- a/sb-gpu +++ b/sb-gpu @@ -1,13 +1,17 @@ #!/bin/sh getGPUClock() { - echo "$GPUClock" | 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 } getGPUBusy() { - echo "$GPUBusy" | cat /sys/class/drm/card1/device/gpu_busy_percent + cat /sys/class/drm/card1/device/gpu_busy_percent } getGPUTemperature() { - echo "$GPUTemp" | sed "s/000//" /sys/class/drm/card1/device/hwmon/hwmon1/temp1_input + sed "s/000//" /sys/class/drm/card1/device/hwmon/hwmon1/temp1_input +} +getGPUVRAM() { + usedRAM=$(cat /sys/class/drm/card1/device/mem_info_vram_used) + numfmt --to=iec $usedRAM --format %2.2f } case $BLOCK_BUTTON in @@ -18,4 +22,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -printf "%s %s%% 🌡️%s°\n" "$(getGPUClock)" "$(getGPUBusy)" "$(getGPUTemperature)" +printf "%s %s %s%% 🌡️%s°\n" "$(getGPUClock)" "$(getGPUVRAM)" "$(getGPUBusy)" "$(getGPUTemperature)" -- cgit v1.2.3