summaryrefslogtreecommitdiff
path: root/sb-gpu
diff options
context:
space:
mode:
Diffstat (limited to 'sb-gpu')
-rwxr-xr-xsb-gpu12
1 files 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)"