New backup 2024-04-24 15:00:02
This commit is contained in:
parent
8561a3726d
commit
dd63a341c8
1 changed files with 10 additions and 7 deletions
|
@ -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' )
|
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
|
if [[ ${check_hour#0} -ge ${current_hour#0} ]];then
|
||||||
echo "future"
|
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
|
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
|
done
|
||||||
exit
|
|
||||||
for d in {1..2};do
|
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
|
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
|
echo $daily_forecast
|
||||||
High: ${high_f}°F | Low: ${low_f}°F
|
|
||||||
|
notify-send "${weather_desc}, ${current_f}°F (${high_f}°F/${low_f}°F)
|
||||||
|
${hourly_forecast}
|
||||||
${daily_forecast}"
|
${daily_forecast}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue