[waybar] Fix GPU power draw path.

This commit is contained in:
Viyurz 2024-08-06 18:15:24 +02:00
parent 26472739be
commit b134a13c1c
Signed by: Viyurz
SSH key fingerprint: SHA256:IskOHTmhHSJIvAt04N6aaxd5SZCVWW1Guf9tEcxIMj8

View file

@ -6,7 +6,7 @@ if (( $hwmon_nr_amd >= 0 )); then
hwmon_path="/sys/class/hwmon/hwmon$hwmon_nr_amd"
usage=$(cat "$hwmon_path/device/gpu_busy_percent")
vram=$(awk '{ print int($1/1024/1024) }' "$hwmon_path/device/mem_info_vram_used")
power=$(head -c -7 "$hwmon_path/power1_average")
power=$(head -c -7 "$hwmon_path/power1_input")
elif which nvidia-smi &> /dev/null; then
usage=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits)
vram=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)