19 lines
834 B
Bash
Executable file
19 lines
834 B
Bash
Executable file
#!/bin/bash
|
|
|
|
#jweather=$( curl --silent wttr.in/?format=j1 )
|
|
jweather=$( cat ~/weather.json )
|
|
|
|
current_f=$( jq -r '.current_condition.[].FeelsLikeF' <<< ${jweather} )
|
|
high_f=$( jq -r '.weather.[0].maxtempF' <<< ${jweather} )
|
|
low_f=$( jq -r '.weather.[0].mintempF' <<< ${jweather} )
|
|
weather_desc=$( jq -r '.current_condition.[].weatherDesc.[].value' <<< ${jweather} )
|
|
forecast=""
|
|
for d in {1..2};do
|
|
forecast="${forecast}\n"$( date -d $( jq -r --argjson d ${d} '.weather.[$d].date' <<< ${jweather} ) +'%a' )": High "$( jq -r --argjson d ${d} '.weather.[$d].maxtempF' <<< ${jweather} )"°F, Low"$( jq -r --argjson d ${d} '.weather.[$d].mintempF' <<< ${jweather} )"°F"
|
|
done
|
|
|
|
forecast=$( echo -e $forecast ) # | sed '/^[[:space:]]*$/d' )
|
|
|
|
notify-send "${weather_desc}, ${current_f}°F
|
|
High: ${high_f}°F | Low: ${low_f}°F
|
|
${forecast}"
|