Files
nixconfig/modules/home/wayland/apps/eww/bar/modules/clock.yuck
T
2026-09-10 21:02:27 +02:00

39 lines
1.1 KiB
Plaintext

(defvar date_rev false)
; EWW_TIME ticks every second inside the daemon, so no shell poll is needed.
(defwidget clock-mod []
(module
(eventbox
:onhover "${EWW_CMD} --no-daemonize update date_rev=true"
:onhoverlost "${EWW_CMD} --no-daemonize update date_rev=false"
:onclick "scripts/panel-toggle clock"
:onrightclick "scripts/powermenu-toggle"
(box
:class "datetime"
(overlay
(box
:orientation "v"
(label :show-truncated false
:class "hour"
:text {formattime(EWW_TIME, "%H")})
(label :show-truncated false
:class "minute"
:text {formattime(EWW_TIME, "%M")}))
(revealer
:reveal date_rev
(box
:class "date"
:orientation "v"
(label :show-truncated false
:class "day"
:text {formattime(EWW_TIME, "%d")})
(label :show-truncated false
:class "month"
:text {formattime(EWW_TIME, "%m")}))
)
)
)
)
)
)