(defwidget clock []
  (eventbox :halign "end"
    :onhover "eww update clock_hover=true"
    :onhoverlost "eww update clock_hover=false"
    :onclick "/home/$USER/.config/rofi/notidraw"
    (box :class "clock"
      {clock_hover ? clock_time_s : clock_time_ns})))

(defvar clock_hover false)


(defpoll clock_time_ns :interval "1s" "date '+\%H:\%M'")
(defpoll clock_time_s  :interval "1s" "date '+\%H:\%M:\%S'")
