mirror of
https://git.pumpin.online/funkpower/menologion.git
synced 2026-10-22 18:57:14 +00:00
A Quickshell widget for Hyprland, a waybar module and an eww panel, all reading the same JSON from the typikon CLI so none of them touches the network and all three agree. The Quickshell piece is three separable parts: a Typikon singleton that wraps the CLI and re-reads only when the date rolls over, a Theme singleton that takes colours from JSON with a default for every key, and the widget itself. The legend is built from the week in view rather than hardcoded, because the levels a tradition uses are its own -- six under the Typikon, three under Ruthenian particular law -- and the words for them differ too. The church date shows beside the civil one whenever they differ, which on the old calendar is always. Forefeasts and afterfeasts get their own line instead of crowding out the commemoration that makes the day.
82 lines
2.9 KiB
Plaintext
82 lines
2.9 KiB
Plaintext
;; horologion — the liturgical day for eww
|
|
;;
|
|
;; Include this from your own eww.yuck:
|
|
;;
|
|
;; (include "horologion/horologion.yuck")
|
|
;;
|
|
;; and put (horologion) in a window, or (horologion-bar) in a bar. Set a
|
|
;; jurisdiction by editing the two defpoll commands below; leaving them as
|
|
;; they are follows whatever `typikon --set-default` wrote.
|
|
|
|
(defpoll typikon-day
|
|
:interval "30m"
|
|
:initial "{}"
|
|
`typikon --json`)
|
|
|
|
(defpoll typikon-week
|
|
:interval "30m"
|
|
:initial "{\"days\":[]}"
|
|
`typikon --json --days 7`)
|
|
|
|
;; ── the one-line version, for a bar
|
|
(defwidget horologion-bar []
|
|
(box :class "horologion-bar"
|
|
:space-evenly false
|
|
:spacing 6
|
|
(label :class "glyph" :text {typikon-day.emoji ?: ""})
|
|
(label :class "title"
|
|
:limit-width 42
|
|
:text {typikon-day.title ?: "typikon?"})))
|
|
|
|
;; ── the full panel
|
|
(defwidget horologion []
|
|
(box :class "horologion"
|
|
:orientation "v"
|
|
:space-evenly false
|
|
:spacing 8
|
|
|
|
(box :class "head" :space-evenly false :spacing 11
|
|
(label :class "glyph-big" :text {typikon-day.emoji ?: ""})
|
|
(box :orientation "v" :space-evenly false :halign "start" :hexpand true
|
|
(label :class {typikon-day.feast != "" ? "title feast" : "title"}
|
|
:halign "start"
|
|
:wrap true
|
|
:lines 2
|
|
:text {typikon-day.title ?: "typikon is not on PATH"})
|
|
(label :class {typikon-day.obligation == "obligatory"
|
|
? "sub obligatory" : "sub"}
|
|
:halign "start"
|
|
:text "${typikon-day.weekday ?: ""}${
|
|
typikon-day.season != "" ? " · " : ""}${
|
|
typikon-day.season ?: ""}${
|
|
typikon-day.obligation == "obligatory"
|
|
? " · obligatory" : ""}")
|
|
(label :class "cycle"
|
|
:halign "start"
|
|
:visible {(typikon-day.cycle ?: "") != ""}
|
|
:text {typikon-day.cycle ?: ""})))
|
|
|
|
(label :class "fast"
|
|
:halign "start"
|
|
:text "${typikon-day.fastLabel ?: ""}${
|
|
(typikon-day.reason ?: "") != ""
|
|
? " — " : ""}${typikon-day.reason ?: ""}")
|
|
|
|
(box :class "rule")
|
|
|
|
;; the rest of the week
|
|
(box :orientation "v" :space-evenly false :spacing 2
|
|
(for d in {typikon-week.days ?: []}
|
|
(box :space-evenly false :spacing 9
|
|
(label :class "glyph" :text {d.emoji})
|
|
(label :class "weekday" :width 34 :xalign 0 :text {d.weekday})
|
|
(label :class {d.feast != "" ? "day feast" : "day"}
|
|
:hexpand true :xalign 0 :limit-width 40 :text {d.title}))))
|
|
|
|
(box :class "rule")
|
|
|
|
(box :space-evenly false
|
|
(label :class "pascha" :hexpand true :xalign 0
|
|
:text "Pascha ${typikon-day.pascha ?: ""}")
|
|
(label :class "pascha" :text {typikon-day.churchDate ?: ""}))))
|