From 55ecd1fc03c846744d729fb8ab6c59ef5a8336ea Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Wed, 24 Apr 2024 14:15:02 -0600 Subject: [PATCH] New backup 2024-04-24 14:15:02 --- de/home/.config/sway/scripts/global_shortcuts/weather | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/de/home/.config/sway/scripts/global_shortcuts/weather b/de/home/.config/sway/scripts/global_shortcuts/weather index 1abbb24..aa367fb 100755 --- a/de/home/.config/sway/scripts/global_shortcuts/weather +++ b/de/home/.config/sway/scripts/global_shortcuts/weather @@ -7,11 +7,13 @@ 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 - date -d $( jq -r --argjson d ${d} '.weather.[$d].date' <<< ${jweather} ) +'%A' -# date -d $( jq -r ".weather.[$d].date" <<< ${jweather} ) + 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 -notify-send "Current: ${current_f}°F ${weather_desc} +forecast=$( echo -e $forecast ) # | sed '/^[[:space:]]*$/d' ) + +notify-send "${weather_desc}, ${current_f}°F High: ${high_f}°F | Low: ${low_f}°F -${Forecast}" +${forecast}"