feat!: migrate to ags v3, redesign styles

This commit is contained in:
2025-12-05 20:32:18 -08:00
parent 42b4f99c37
commit 11c257e4b3
14 changed files with 182 additions and 153 deletions

View File

@@ -4,32 +4,17 @@ import { createBinding, For } from "gnim"
export default function Workspaces({ monitor }: { monitor: Gdk.Monitor }) {
const hypr = AstalHyprland.get_default()
const workspaces = createBinding(hypr, "workspaces").as(wss => wss.sort((a, b) => a.id - b.id))
const workspaces = createBinding(hypr, "workspaces").as(wss => wss.filter((ws) => ws.monitor.model === monitor.model).sort((a, b) => a.id - b.id))
return (
<box class="workspaces">
<For each={workspaces}>
{(ws) => (
<button class={createBinding(hypr, "focusedWorkspace").as((fw) => ws === fw ? "focused" : "")}>
<button class={createBinding(hypr, "focusedWorkspace").as((fw) => ws === fw ? "focused" : "")} onClicked={() => ws.focus()}>
<label label={ws.id.toString()} />
</button>
)}
</For>
</box>
)
// return <box className="workspaces">
// {bind(hypr, "workspaces").as(wss => wss.filter(ws => !(ws.id >= -99 && ws.id <= -2))
// .sort((a, b) => a.id - b.id)
// .map(ws => {
// if (ws.monitor.model !== monitor.model) return <></>
// return (
// <button
// className={bind(hypr, "focusedWorkspace").as(fw =>
// ws === fw ? "focused" : "")}
// onClicked={() => ws.focus()}>
// {ws.id}
// </button>
// )
// }))}
// </box>
}