New backup 2024-04-24 15:00:02

This commit is contained in:
Penelope Gwen 2024-04-24 15:00:02 -06:00
parent 8561a3726d
commit dd63a341c8

View file

@ -17,17 +17,20 @@ for h in {0..7};do
check_hour=$( date -d $( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].time' <<< ${jweather} ) +'%H' )
if [[ ${check_hour#0} -ge ${current_hour#0} ]];then
echo "future"
hourly_forecast="${hourly_forecast}\n${check_hour}"$( jq -r --argjson h ${h} '.weather.[0].hourly.[$h]..FeelsLikeF' <<< ${jweather} )
hourly_forecast="${hourly_forecast}\n${check_hour}: "$( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].weatherDesc.[].value' <<< ${jweather} )", "$( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].FeelsLikeF' <<< ${jweather} )"°F"
fi
# hourly_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
exit
for d in {1..2};do
daily_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"
echo $d
daily_forecast="${daily_forecast}\n"$( date -d $( jq -r --argjson d ${d} '.weather.[$d].date' <<< ${jweather} ) +'%a' )": "$( jq -r --argjson d ${d} '.weather.[$d].hourly.[4].weatherDesc.[].value' <<< ${jweather} )" ("$( jq -r --argjson d ${d} '.weather.[$d].maxtempF' <<< ${jweather} )"°F/"$( jq -r --argjson d ${d} '.weather.[$d].mintempF' <<< ${jweather} )"°F)"
done
forecast=$( echo -e $forecast ) # | sed '/^[[:space:]]*$/d' )
hourly_forecast=$( echo -e $hourly_forecast | sed '/^[[:space:]]*$/d' )
daily_forecast=$( echo -e $daily_forecast ) # | sed '/^[[:space:]]*$/d' )
notify-send "${weather_desc}, ${current_f}°F
High: ${high_f}°F | Low: ${low_f}°F
echo $daily_forecast
notify-send "${weather_desc}, ${current_f}°F (${high_f}°F/${low_f}°F)
${hourly_forecast}
${daily_forecast}"