elenapan/config/eww/scripts/daemons/gpu.sh
2024-12-14 01:41:23 +02:00

13 lines
338 B
Bash
Executable file

#!/bin/bash
# Not sure if this works on NVIDIA cards
update() {
eww update gpu="$(cat /sys/class/drm/card0/device/gpu_busy_percent)"
# Alternatively: With amdgpu_top
# eww update gpu="$(amdgpu_top -gm --single | awk '/average_gfx_activity/ {print substr($2, 1, length($2)-1)}')"
}
while true; do
update
sleep 5
done