mirror of
https://github.com/nboughton/dotfiles
synced 2025-04-21 00:37:54 +02:00
13 lines
288 B
Bash
Executable File
13 lines
288 B
Bash
Executable File
#!/bin/bash
|
|
|
|
n=$(cat /sys/class/drm/card0/device/gpu_busy_percent)
|
|
class="normal"
|
|
|
|
if [[ $n -gt 60 ]]; then
|
|
class="warning"
|
|
elif [[ $n -gt 80 ]]; then
|
|
class="critical"
|
|
fi
|
|
|
|
echo "{ \"text\": \"$(printf '%2d' $n)\", \"tooltip\": \"$n%\", \"percentage\": $n, \"class\": \"$class\" }"
|