workspace for ags much more lokig
This commit is contained in:
parent
464701d8cb
commit
9919b73f58
|
@ -9,9 +9,13 @@ const date = Variable("", {
|
||||||
})
|
})
|
||||||
|
|
||||||
function Workspaces() {
|
function Workspaces() {
|
||||||
const activeId = hyprland.active.workspace.bind("id")
|
const activeId = hyprland.active.workspace.bind("id");
|
||||||
const workspaces = hyprland.bind("workspaces")
|
const workspaces = hyprland.bind("workspaces").as((ws) =>
|
||||||
.as(ws => ws.map(({ id }) => Widget.Button({
|
ws
|
||||||
|
.filter(({ id }) => id > 0)
|
||||||
|
.sort((a, b) => a.id - b.id)
|
||||||
|
.map(({ id }) =>
|
||||||
|
Widget.Button({
|
||||||
on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
|
on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
|
||||||
child: Widget.Label(`${id}`),
|
child: Widget.Label(`${id}`),
|
||||||
class_name: activeId.as(i => `${i === id ? "focused" : ""}`),
|
class_name: activeId.as(i => `${i === id ? "focused" : ""}`),
|
||||||
|
|
Loading…
Reference in a new issue