dotfiles/de/home/.config/eww/modules/bar/workspaces.yuck
2025-07-12 16:00:02 -07:00

18 lines
595 B
Text

(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 {captures(entry.num, '[1-9]')}))))))
;; :text {captures(entry.num, '/.{2}$/g')}))))))