flakes/res/eww-wayland/eww.yuck

58 lines
1.8 KiB
Text

(defwindow mainbar :monitor 0
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
:height "30px"
:anchor "top center")
:stacking "fg"
:exclusive false
:focusable false
(bar))
(defpoll ptime :interval "1s"
`date +%H:%M`)
(defpoll petimea :interval "1s"
`date "+%A, %d %B %Y "`)
(defpoll petimeb :interval "1s"
`date "+:%S"`)
(deflisten ltitle "./scripts/title.sh")
(deflisten lworkspaces :initial "[]" "./scripts/workspaces.sh")
(deflisten lcurrent_workspace :initial "1" "./scripts/active-workspace.sh")
(defwidget bar []
(eventbox :onscroll "./scripts/scroll.sh {}"
(centerbox :orientation "h"
:class "bar"
(workspaces)
(title)
(time))))
(defwidget workspaces []
(box :class "widget workspaces"
:halign "start"
:valign "center"
:vexpand true
:hexpand true
(for workspace in lworkspaces
(eventbox :cursor "hand"
(button :class "${workspace.id == lcurrent_workspace ? "focused" : (workspace.windows > 0 ? "occupied" : "empty")}"
:onclick "hyprctl dispatch workspace ${workspace.id}"
"${workspace.id == lcurrent_workspace ? "" : (workspace.windows > 0 ? "" : "")}")))))
(defwidget title []
(literal :content ltitle))
(defwidget time_extension [text]
(label :text text
:class "extension"))
(defwidget time []
(box :orientation "horizontal"
:space-evenly false
:halign "end"
:class "widget time"
(time_extension :text petimea)
(label :text ptime
:class "base")
(time_extension :text petimeb)))