diff --git a/de/home/.config/eww/modules/bar/workspaces.yuck b/de/home/.config/eww/modules/bar/workspaces.yuck index c22c493..2af759a 100644 --- a/de/home/.config/eww/modules/bar/workspaces.yuck +++ b/de/home/.config/eww/modules/bar/workspaces.yuck @@ -1,6 +1,7 @@ (deflisten workspacesArray :initial '[{"name": "placeholder","focused":true,"num":0}]' 'scripts/bar/workspaces') + (defwidget workspaces [array] (box :class "workspaces" :orientation "h" @@ -8,10 +9,39 @@ :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 {jq(captures(entry.num, '[0-9]$'),'.[].[]','r')})))))) +; {entry.focused ? (workspace :ws entry) : ""}))) +; (for ws in {} + (literal + :content {entry.focused ? "(workspace :ws entry)" : ""})))) +;; {entry.focused ? "${entry.num}" : ""}))) +; (button :onclick `swaymsg workspace "${entry.name}"` +; :class {entry.focused ? "focused" : ""} +; (box +; '${replace(entry.name,".*:","")}' +; (label +; :class "workspace-number" +; :text {jq(captures(entry.num, '[0-9]$'),'.[].[]','r')})))))) + +(defwidget workspace [ws] + (button :onclick `swaymsg workspace "${ws.name}"` + :class {ws.focused ? "focused" : ""} + (box + '${replace(ws.name,".*:","")}' + (label + :class "workspace-number" + :text {jq(captures(ws.num, '[0-9]$'),'.[].[]','r')})))) + +;(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 {jq(captures(entry.num, '[0-9]$'),'.[].[]','r')}))))))