import Hyprland from "gi://AstalHyprland"; import { App } from "astal/gtk4"; import { Astal, type Gdk, Gtk } from "astal/gtk4"; import { getHyprlandMonitor } from "../utils/monitors"; import { Workspaces } from "./sections/Workspace"; import { bind, type Binding, Variable } from "astal"; const hypr = Hyprland.get_default(); interface AddWorkspaceButtonProps { show: Binding; cssClasses: string[]; } const AddWorkspaceButton = ({ show, cssClasses }: AddWorkspaceButtonProps) => { return ( ); }; export default function SecondaryBar( monitor: Gdk.Monitor, relation: "top" | "bottom" | "left" | "right", ) { const { TOP, LEFT, RIGHT, BOTTOM } = Astal.WindowAnchor; const hyprlandMonitor = getHyprlandMonitor(monitor); const anchor = { top: BOTTOM | LEFT, left: TOP | RIGHT, right: TOP | LEFT, bottom: TOP | LEFT, }[relation]; const cssClasses = { top: ["SecondaryBar", "top"], left: ["SecondaryBar", "left"], right: ["SecondaryBar", "right"], bottom: ["SecondaryBar", "bottom"], }[relation]; const alignment = { top: Gtk.Align.START, left: Gtk.Align.END, right: Gtk.Align.START, bottom: Gtk.Align.START, }[relation]; const showAddWorkspaceButton = Variable(false); const monitorFocused = bind(hypr, "focusedMonitor").as( (fm) => fm === hyprlandMonitor, ); return ( showAddWorkspaceButton.set(true)} onHoverLeave={() => showAddWorkspaceButton.set(false)} > x ? cssClasses : [...cssClasses, "inactive"], )} > {relation === "left" ? ( ) : null} {relation !== "left" ? ( ) : null} ); }