ags: To derivation

This commit is contained in:
2026-08-19 21:41:34 +03:00
committed by Sweetbread
parent 71bb0a839e
commit 7df28b1a5d
15 changed files with 24 additions and 5 deletions
@@ -0,0 +1,21 @@
import { bind } from "astal"
import Hyprland from "gi://AstalHyprland"
export default function Workspaces() {
const hypr = Hyprland.get_default()
return <box className="Workspaces">
{bind(hypr, "workspaces").as(wss => wss
.filter(ws => !(ws.id >= -99 && ws.id <= -2)) // filter out special workspaces
.sort((a, b) => a.id - b.id)
.map(ws => (
<button
className={bind(hypr, "focusedWorkspace").as(fw =>
ws === fw ? "focused" : "")}
onClicked={() => ws.focus()}>
{ws.id}
</button>
))
)}
</box>
}