49 lines
971 B
Bash
Executable file
49 lines
971 B
Bash
Executable file
#!/bin/bash
|
|
|
|
wttr_cache="${HOME}/.cache/wttr.json"
|
|
#jq -r '.current_condition[0].weatherCode' ${wttr_cache}
|
|
jq -r '.current_condition[0].weatherCode' ${wttr_cache}
|
|
condition_code="$(jq -r '.current_condition[0].weatherCode' ${wttr_cache})"
|
|
|
|
case "${condition_code}" in
|
|
113)
|
|
#Sunny
|
|
echo ""
|
|
;;
|
|
116|119|122|143)
|
|
#Partly cloudy
|
|
#Cloudy
|
|
#Overcast
|
|
#Mist
|
|
echo ""
|
|
;;
|
|
179|227|230)
|
|
#Patchy snow possible
|
|
#Blowing snow
|
|
#Blizzard
|
|
echo ""
|
|
;;
|
|
248|260)
|
|
#Fog
|
|
#Freezing fog
|
|
echo "▒"
|
|
;;
|
|
176|182|185|200|263|266|281|284|293|296|299|302|305|308|311)
|
|
#Patchy rain possible
|
|
#Patchy sleet possible
|
|
#Patchy freezing drizzle possible
|
|
#Thundery outbreaks possible
|
|
#Patchy light drizzle
|
|
#Light drizzle
|
|
#Freezing drizzle
|
|
#Heavy freezing drizzle
|
|
#Patchy light rain
|
|
#Light rain
|
|
#Moderate rain at times
|
|
#Moderate rain
|
|
#Heavy rain at times
|
|
#Heavy rain
|
|
#Light freezing rain
|
|
echo ""
|
|
;;
|
|
esac
|