dotfiles/de/home/.config/eww/modules/home/weather.yuck
2025-07-18 14:45:02 -07:00

32 lines
961 B
Text

(defpoll weather_status :initial '{"condition":"loading...","current_temp":"--","feels_temp":"--","min_temp":"--","max_temp":"--","humidity":"--","icon":" ","updated":"loading..."}'
:interval "3600s"
'scripts/home/hass_weather')
(defvar reveal_weather true)
(defwidget weather_revealer []
(revealer-on-press
:revealvar reveal_weather
:revealvar-name "reveal_weather"
:width 250
(button
:width 250
:class "revealer-title"
"Weather ${reveal_weather ? '' : ''}")
(weather :json weather_status)))
(defwidget weather [json]
(box
:class "weather"
:orientation "v"
:width 250
:height 125
:space-evenly true
"${json.condition} ${json.icon}"
"${json.current_temp}󰔅  / ${json.humidity}% "
"󰄿 ${json.max_temp}󰔅 | 󰄼 ${json.min_temp}󰔅"
(label
:class "weather-subtitle"
:text " ${json.updated}"
)))