import { bind } from "astal"
import Hyprland from "gi://AstalHyprland"
export default function Workspaces(props: { monitor: string, iconSide: "left" | "right" }) {
const hyprland = Hyprland.get_default();
return
{props.iconSide == "left" && }
{bind(hyprland, "workspaces").as(wss => wss
.filter(it => it && it.get_monitor && it.get_monitor().name == props.monitor)
.sort((a, b) => a.get_id() - b.get_id())
.map(workspace => )
)}
{props.iconSide == "right" && }
}
function Workspace(props: { workspace: Hyprland.Workspace }) {
const hyprland = Hyprland.get_default();
return
{bind(props.workspace.get_monitor(), "activeWorkspace").as(ws => {
if (ws == props.workspace) {
return
} else {
return
}
})}
}