New backup 2025-07-24 10:15:02
This commit is contained in:
parent
447185d311
commit
59f3c990e3
1 changed files with 37 additions and 7 deletions
|
@ -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')}))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue