(defvar ws-icons '["一", "二", "三", "四", "五", "六", "七", "八", "九", "十"]')

(deflisten curr :initial "1" "./bar/workspaces/get-active-workspace.sh")
(deflisten wps :initial "[1, 2, 3]" "./bar/workspaces/get-workspaces.sh")
(defwidget workspaces []
 (box
  :space-evenly true
  (for workspace in wps
   (eventbox :onclick "hyprctl dispatch workspace ${workspace}"
    (box
     :width 36
     :height 36
     :class "${workspace == curr ? "accent" : ""}"
     (label
      :style "font-size: 1.3rem;"
      :text "${ws-icons[workspace - 1]}"
      ))))))
