This commit is contained in:
Mikhail Kilin
2026-06-21 16:22:06 +03:00
parent 698c953c55
commit 8cedd606f5
58 changed files with 4333 additions and 146 deletions

9
fedora/waybar/scripts/gpu.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
data=$(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,noheader,nounits 2>/dev/null)
if [ -z "$data" ]; then
echo '{"text": "GPU N/A", "tooltip": "nvidia-smi not available"}'
exit 0
fi
usage=$(echo "$data" | cut -d',' -f1 | tr -d ' ')
temp=$(echo "$data" | cut -d',' -f2 | tr -d ' ')
echo "{\"text\": \"GPU ${usage}% ${temp}°C\", \"tooltip\": \"GPU: ${usage}%\\nTemp: ${temp}°C\", \"class\": \"\"}"