(deflisten workspacesArray :initial "${[{"name": "placeholder","focused":true}]}" 'scripts/bar/workspaces') (defwidget workspaces [array] (box :class "workspaces" :orientation "h" :space-evenly false :halign "start" (for entry in array (button :onclick `swaymsg workspace "${entry.name}"` :class {entry.focused ? "focused" : ""} (box '${replace(entry.name,".*:","")}' (label :class "workspace-number" :text {entry.num}))))))