dotfiles/.config/eww/widgets/clock/clock.yuck

15 lines
472 B
Plaintext

(defwidget clock []
(eventbox :halign "end"
:onhover "eww update clock_hover=true"
:onhoverlost "eww update clock_hover=false"
:onclick notification_cmd
(box :class "clock"
{clock_hover ? clock_time_s : clock_time_ns})))
(defvar clock_hover false)
(defvar notification_cmd "widgets/notification-draw/toggle-notification-draw")
(defpoll clock_time_ns :interval "1s" "date '+\%H:\%M'")
(defpoll clock_time_s :interval "1s" "date '+\%H:\%M:\%S'")