dotfiles/de/home/.config/sway/scripts/global_shortcuts/weather
2024-04-24 14:00:02 -06:00

17 lines
637 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} )
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} )
done
notify-send "Current: ${current_f}°F ${weather_desc}
High: ${high_f}°F | Low: ${low_f}°F
${Forecast}"