Files
arthur-os/bin/omarchy-weather-status
2026-05-14 12:02:53 +02:00

18 lines
442 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Returns a formatted weather status string with temperature and wind speed.
weather=$(curl -fsS --max-time 4 "https://wttr.in?format=%l|%t|%w" 2>/dev/null | tr -d '\n')
if [[ -z $weather ]]; then
echo "Weather unavailable"
exit 1
fi
IFS='|' read -r place temperature wind <<< "$weather"
place=${place%%,*}
place=${place^}
temperature=${temperature#+}
echo "$place · Temp $temperature · Wind $wind"