fixes
This commit is contained in:
9
fedora/waybar/scripts/gpu.sh
Executable file
9
fedora/waybar/scripts/gpu.sh
Executable 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\": \"\"}"
|
||||
8
fedora/waybar/scripts/weather.sh
Executable file
8
fedora/waybar/scripts/weather.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
weather=$(curl -s "wttr.in/?format=%c%t" 2>/dev/null)
|
||||
if [ -z "$weather" ] || echo "$weather" | grep -q "Unknown"; then
|
||||
echo '{"text": "N/A", "tooltip": "Weather unavailable"}'
|
||||
exit 0
|
||||
fi
|
||||
tooltip=$(curl -s "wttr.in/?format=%l:+%C+%t+%w+%h" 2>/dev/null)
|
||||
echo "{\"text\": \"${weather}\", \"tooltip\": \"${tooltip}\"}"
|
||||
Reference in New Issue
Block a user