Adds little icon for current hour

This commit is contained in:
Michel Fedde 2025-11-11 20:40:43 +01:00
parent a459185bb8
commit 1ec52c1412
3 changed files with 43 additions and 16 deletions

View file

@ -1,5 +1,26 @@
(defpoll hour-time :interval '1s' :initial '0' `date +"%H"`)
(defwidget hour-icon []
(box
(image
:visible {hour-time <= 6 || hour-time > 22}
:icon "time_moon"
)
(image
:visible {hour-time > 6 && hour-time <= 10}
:icon "time_moon_to_sun"
)
(image
:visible {hour-time > 10 && hour-time <= 18}
:icon "time_sun"
)
(image
:visible {hour-time > 18 && hour-time <= 22}
:icon "time_sun_to_moon"
)
)
)
(defwidget hour-notify []
(eventbox
:onclick "${EWW_CMD} close hour"
@ -9,22 +30,7 @@
:width 150
:orientation "v"
:space-evenly false
(image
:visible {hour-time <= 6 || hour-time > 22}
:icon "time_moon"
)
(image
:visible {hour-time > 6 && hour-time <= 10}
:icon "time_moon_to_sun"
)
(image
:visible {hour-time > 10 && hour-time <= 18}
:icon "time_sun"
)
(image
:visible {hour-time > 18 && hour-time <= 22}
:icon "time_sun_to_moon"
)
(hour-icon)
(label
:text "Now: ${hour-time}:00"
)