nixos-config/ahrc-laptop/eww/eww.yuck
2024-11-04 15:49:10 +01:00

64 lines
1,007 B
Text

(deflisten workspaces
:initial "[]"
"./listen/niri/workspaces"
)
(defvar workspace-icon '{
"admin": "",
"everything": "",
"apps": ""
}')
(defwidget workspaces []
(box
:class "workspaces"
(for workspace in {workspaces}
(eventbox
:onclick "niri msg action focus-workspace ${workspace.idx}"
:width 25
:class "workspace-button${workspace.is_active ? " workspace-active" : ""}"
"${"${workspace-icon?.[workspace.name]}" ?: ""} "
)
)
)
)
(defwidget time []
"${formattime(EWW_TIME, "%Y-%m-%d")} ${formattime(EWW_TIME, "%H:%M:%S")}"
)
(defwindow dock
:monitor 0
:geometry (geometry
:x "0"
:y "0"
:width "100%"
:height "30px"
:anchor "bottom center"
)
:stacking "fg"
:exclusive true
(centerbox
(box
:class "left"
:halign "start"
:space-evenly false
(workspaces)
)
(box
:class "middle"
(time)
)
(box
:class "right"
)
)
)