(defwidget workspaceWidget []
  (box 
    :class "workspaces"
    (for workspace in workspaces
      (button
        :style "border-bottom: 4px solid ${workspace.color}${workspace.active ? "; background-color: #3c3836" : ""}"
        :class "${workspace.focused ? "focused" : ""}"
        :onclick "swaymsg workspace ${workspace.name}"
        (label :text "${workspace.idx}")
      )
    )
  )
)

(deflisten workspaces
  :initial "[]"
  "bar-ws-monitor"
)
