dotfiles/dotconfig/eww/analog_clock/clock.yuck

78 lines
1.2 KiB
Text
Raw Normal View History

2024-01-29 13:31:17 +01:00
2024-03-15 15:05:00 +01:00
2024-01-29 13:31:17 +01:00
(defpoll hours
:interval "1s"
:initial "00"
`date +%I`)
(defpoll minutes
:interval "1s"
:initial "00"
`date +%M`)
(defpoll ampm
:interval "1s"
:initial "00"
`date +%p`)
(defpoll date
:interval "1s"
:initial "1970-01-01"
`date +%Y-%m-%d`)
(defwidget clock []
(box :vexpand false :hexpand false
2024-03-04 15:46:28 +01:00
:width 180
:height 180
2024-01-29 13:31:17 +01:00
:space-evenly false
2024-03-04 15:46:28 +01:00
(box :width 180 :height 180 :class "analog-clock")
2024-01-29 13:31:17 +01:00
(box
2024-03-04 15:46:28 +01:00
:height 180
2024-03-15 15:05:00 +01:00
:width 180
2024-01-29 13:31:17 +01:00
:class "numerical-clock"
:orientation "v"
:space-evenly false
(box
:class "time-container"
(box
2024-03-04 15:46:28 +01:00
:class "time"
2024-01-29 13:31:17 +01:00
(label :text hours)
)
(box
:class "time"
(label :text minutes)
)
(box
:class "time"
(label :text ampm)
)
)
(box
:class "date"
(label :text " ${date}")
)
)
))
(defwindow clock
:monitor 0
:geometry (geometry
2024-03-04 15:46:28 +01:00
:x "5%"
2024-03-15 15:05:00 +01:00
:y "35%"
:height "200px"
:anchor "top right")
2024-01-29 13:31:17 +01:00
:stacking "bg"
:exclusive true
:focusable false
:namespaces "widget_clock"
(clock))