import { bind } from "astal";
import { Gdk, Gtk } from "astal/gtk4";
import Hyprland from "gi://AstalHyprland";
import Rsvg from "gi://Rsvg?version=2.0";
const Workspaces = function () {
const hyprland = Hyprland.get_default();
const workspaces = bind(hyprland, "workspaces").as((workspaces) =>
workspaces
.filter((workspace) => workspace.id > 0)
.sort((a, b) => {
if (a.id > b.id) {
return 1;
} else if (a.id < b.id) {
return -1;
}
return 0;
}),
);
const focusedWorkspace = bind(hyprland, "focused_workspace");
const specialWorkspaces = bind(hyprland, "workspaces").as((workspaces) =>
workspaces.filter((workspace) => workspace.id < 0),
);
Gtk.Image.interface_install_property;
const activeTrianglePath =
'';
const inactiveTrianglePath =
'';
const activeTrianglePixBuf =
Rsvg.Handle.new_from_data(activeTrianglePath).get_pixbuf();
const inactiveTrianglePixBuf =
Rsvg.Handle.new_from_data(inactiveTrianglePath).get_pixbuf();
return (
{workspaces.as((workspaces) => {
return workspaces.map((workspace) => (
));
})}
);
};
export default Workspaces;