Introduces eww bar
This commit is contained in:
parent
75bc7eb6a7
commit
e58899e4ae
30 changed files with 279 additions and 1147 deletions
76
.config/eww/widgets/bar/elements/workspaces.yuck
Normal file
76
.config/eww/widgets/bar/elements/workspaces.yuck
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
(defpoll bar-workspace-data :interval "0.1s" :initial "[]" `~/.config/eww/widgets/bar/scripts/workspaces.sh`)
|
||||
|
||||
(defwidget bar-workspaces []
|
||||
(box
|
||||
:class "widget workspaces"
|
||||
:space-evenly false
|
||||
:hexpand false
|
||||
:halign "start"
|
||||
(for workspace in bar-workspace-data
|
||||
(eventbox
|
||||
:onclick "${EWW_CMD} open bar-workspace-window --arg workspaceId=${workspace.id}"
|
||||
:cursor "pointer"
|
||||
(box
|
||||
:space-evenly false
|
||||
:spacing 10
|
||||
:class "workspace ${workspace.activeOnAnyScreen ? "active": ""} ${workspace.activeOnCurrentScreen ? "current": ""}"
|
||||
|
||||
(box
|
||||
:space-evenly false
|
||||
:spacing 10
|
||||
(label
|
||||
:text {workspace.name}
|
||||
)
|
||||
(box
|
||||
:spacing 10
|
||||
(for window in {workspace.windows}
|
||||
(label
|
||||
:text {window.icon}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow bar-workspace-window [workspaceId]
|
||||
:monitor 1
|
||||
:geometry (geometry
|
||||
:x "10px"
|
||||
:y "50px"
|
||||
:width "512px"
|
||||
:height "0px"
|
||||
:anchor "top left")
|
||||
:stacking "fg"
|
||||
|
||||
(box
|
||||
|
||||
(for workspace in bar-workspace-data
|
||||
(box
|
||||
:orientation "v"
|
||||
:vexpand false
|
||||
:valign "start"
|
||||
:class "widget default-padding"
|
||||
:space-evenly false
|
||||
:spacing 10
|
||||
:visible {workspaceId == workspace.id}
|
||||
(for window in {workspace.windows}
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:onclick "hyprctl dispatch focuswindow pid:${window.pid} && ${EWW_CMD} close bar-workspace-window"
|
||||
:onrightclick "${EWW_CMD} close bar-workspace-window"
|
||||
|
||||
(label
|
||||
:halign "start"
|
||||
:text "${window.icon} ${window.title}"
|
||||
:truncate false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue