33 lines
1.4 KiB
Plaintext
33 lines
1.4 KiB
Plaintext
; Weather data
|
|
(defpoll weatherdata :interval "15m" `wttr/wttr.py`)
|
|
|
|
(defwidget weather []
|
|
(box :class "genwin" :style "background-image: url('${weatherdata.current_condition[0].weatherCode}');background-size: cover;"
|
|
(box :orientation "v" :spacing 10 :space-evenly false :vexpand false :hexpand false
|
|
(box :orientation "h" :spacing 0 :vexpand false :hexpand false
|
|
(label :class "label_temp" :halign "center" :text "${weatherdata.current_condition[0].temp_C}")
|
|
)
|
|
(box :orientation "v" :spacing 10 :halign "center" :space-evenly false :vexpand false :hexpand false
|
|
(label :class "label_stat" :text "${weatherdata.current_condition[0].weatherDesc[0].value}")
|
|
(box
|
|
:class "areabox"
|
|
:orientation "h"
|
|
:spacing 10
|
|
:space-evenly false
|
|
:vexpand false
|
|
:hexpand false
|
|
:halign "center"
|
|
(label :class "label_quote" :text "${weatherdata.nearest_area[0].country[0].value}")
|
|
(label :class "label_quote" :text "${weatherdata.nearest_area[0].region[0].value}")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
; Weather window
|
|
(defwindow weather :stacking "bg" :focusable true :exclusive true :screen 1 :windowtype "dock"
|
|
:geometry (geometry :x 100 :y 100 :width 610 :height 280)
|
|
(weather)
|
|
)
|