nixos/absol/eww/config/widgets/workspaces/eww.yuck

18 lines
No EOL
869 B
Text

(deflisten workspaces :initial "[]" "bash ./widgets/workspaces/get-workspaces.sh")
(deflisten current_workspace :initial "1" "bash ./widgets/workspaces/get-active-workspace.sh")
(defwidget workspaces []
(eventbox :onscroll "bash ./widgets/workspaces/change-active-workspace.sh {} ${current_workspace}" :class "workspaces-widget"
(box :space-evenly true
(label :text "${workspaces}${current_workspace}" :visible false)
(for workspace in workspaces
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
(box :width "30" :height "30" :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
(label :text {workspace.id == current_workspace ? "" : workspace.windows > 0 ? "" : ""}
)
)
)
)
)
)
)