(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 0
    (for workspace in workspaces
      (eventbox
        :width 40
        :onclick "hyprctl dispatch workspace ${workspace.id}"
        :cursor "pointer"
        :tooltip "${workspace.name}"
        :class "workspaces--ws ${workspace.active == true ? 'workspaces--ws--active' : 'workspaces--ws--inactive'} ${workspace.name == 1 ? 'first' : workspace.name == 10 ? 'last' : 'middle'}"
        (label 
          :class "workspaces--ws--label"
          :text "${workspace.windows > 0 ? ' ${workspace.windows}' : ''}")))))
