mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-04-26 18:33:42 +02:00
20 lines
357 B
Bash
Executable file
20 lines
357 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
file_exists() {
|
|
if [ -f "$1" ]; then
|
|
return 0
|
|
else
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
device_id="0"
|
|
gpu_busy_file="/sys/class/hwmon/hwmon$device_id/device/gpu_busy_percent"
|
|
|
|
if file_exists "$gpu_busy_file"; then
|
|
gpu_busy_percent=$(cat "$gpu_busy_file")
|
|
echo "$gpu_busy_percent"
|
|
else
|
|
echo "Error !" >&2
|
|
exit 1
|
|
fi
|