user/eww-wayland: bring back shortened time

This commit is contained in:
LavaDesu 2025-03-13 22:56:26 +11:00
parent b362462905
commit c1c6c0102f
Signed by: cilly
GPG key ID: 6500251E087653C9

View file

@ -20,13 +20,16 @@
:focusable false :focusable false
(bar)) (bar))
(defpoll ptime :interval "1s"
(defvar time-extended false)
(defpoll ptime :interval "1s"
`date +%H:%M`) `date +%H:%M`)
(defpoll petimea :interval "1s" (defpoll petimea :interval "1s" :run-while time-extended
`date "+%A, %d %B %Y "`) `date "+%A, %d %B %Y "`)
(defpoll petimeb :interval "1s" (defpoll petimeb :interval "1s" :run-while time-extended
`date "+:%S"`) `date "+:%S"`)
(deflisten ltitle :initial "" "./scripts/title.sh") (deflisten ltitle :initial "" "./scripts/title.sh")
(deflisten lworkspaces :initial "[]" "./scripts/workspaces.sh") (deflisten lworkspaces :initial "[]" "./scripts/workspaces.sh")
(deflisten lcurrent_workspace :initial "1" "./scripts/active-workspace.sh") (deflisten lcurrent_workspace :initial "1" "./scripts/active-workspace.sh")
@ -59,11 +62,14 @@
:class "extension")) :class "extension"))
(defwidget time [] (defwidget time []
(box :orientation "horizontal" (button :onclick `eww update time-extended=${time-extended ? "false" : "true"}`
:space-evenly false (box :orientation "horizontal"
:halign "end" :space-evenly false
:class "widget time" :halign "end"
(time_extension :text petimea) :class "widget time"
(label :text ptime (time_extension :text {time-extended ? petimea : ""})
:class "base") (label :text ptime
(time_extension :text petimeb))) :class "base")
(time_extension :text {time-extended ? petimeb : ""})
)))