summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Drake <joshua.ellis.drake@gmail.com>2023-11-10 01:14:11 -0600
committerJoshua Drake <joshua.ellis.drake@gmail.com>2023-11-10 01:16:23 -0600
commitea81343cdfeb6e9c09e1bf45a8ef0935459f15b5 (patch)
tree745d4dcfdf4b50b0b548f7d1dbe76f01f0851acf
parent9f6592813bfc8edb282c549070eb6e1aff838f91 (diff)
Consolidated deez VRAM Yamean? Word to your mother. -Dallas
-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)"