(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces.sh")
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace.sh")
(defwidget workspaces-module []
  (box :space-evenly true
       (label :text "${workspaces}${current_workspace}"
              :visible false)
    (for workspace in workspaces
         (eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
                   (label :text "${workspace.id == current_workspace ? "" : ""}"
                          :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}")))))
