feat(eww): add mediaplayer widget, fix workspaces, window and audio widgets

This commit is contained in:
João Dias
2024-11-24 11:14:12 -03:00
parent 88af8f4a37
commit f7ae531efd
11 changed files with 115 additions and 71 deletions
+11 -8
View File
@@ -1,15 +1,18 @@
(deflisten json_workspaces
:initial "[{1: {}, 2:{}}]"
`hyprctl -j workspaces`)
(deflisten json_workspaces :initial '[{"id": "1"},{"id": "2"}]'
`sh ./scripts/workspaces.sh`)
(deflisten json_active_workspace :initial '{ "id": 1 }'
`sh ./scripts/active-workspace.sh`)
(defwidget workspaces []
(eventbox :onscroll "[[ {} =~ up ]] && hyprctl dispatch workspace e+1 || hyprctl dispatch workspace e-1"
(eventbox :onscroll "[[ {} == up ]] && hyprctl dispatch workspace e+1 || hyprctl dispatch workspace e-1"
(box :class "workspaces"
(for i in json_workspaces
(button :onclick "hyprctl dispatch workspace ${i}"
"${i[0].num}")
(for workspace in json_workspaces
(button :onclick "hyprctl dispatch workspace ${workspace.id}"
:class "${ json_active_workspace.id == workspace.id ? "active" : "default" }"
"${workspace.id}")
)
)
)
)
)