(deflisten workspaces :initial "" "hyprman -w 2>>/tmp/eww_hyprman_workspaces.log")

(defvar workspaceIcons '{
  "empty": "",
  "full": "",
  "focused": "󱓻"
}')

(defwidget hypr_workspaces []
  (box
    :class "workspaces"
    :space-evenly false
    :spacing 3
    (for workspace in workspaces
      (eventbox
        :height 20
        :width 20
        :onclick "hyprctl dispatch workspace ${workspace.id}"
        :cursor "pointer"
        :tooltip "${workspace.name}"
        :class "workspaces--ws${workspace.windows > 0 ? '' : ' workspace--ws--empty'}${workspace.active == true ? ' workspaces--ws--active' : ' workspaces--ws--inactive'}"
        (label 
          :class "workspaces--ws--label"
          :xalign 0.2
          :yalign 0.5
          :text "")))))
