import { Variable, bind } from "astal";
import { App, Astal, Gtk } from "astal/gtk4";
import { hideWindow } from "@lib/utils";
import Hyprland from "gi://AstalHyprland";
import Apps from "gi://AstalApps";
const hide = () => App.get_window("launcher")?.hide();
function AppButton({ app }: { app: Apps.Application }) {
return
}
export default function Launcher(_monitor_id: number) {
const { TOP, BOTTOM, LEFT, RIGHT } = Astal.WindowAnchor;
const hypr = Hyprland.get_default();
const apps = new Apps.Apps();
const query = Variable("")
const list = query(text => apps.fuzzy_query(text).slice(0, 10))
const onEnter = () => {
hide()
list.get().at(0)!.launch()
}
return monitor.id)}
name={"launcher"}
cssClasses={["launcher"]}
keymode={Astal.Keymode.EXCLUSIVE}
anchor={TOP | BOTTOM | LEFT | RIGHT}
onKeyPressed={hideWindow}
application={App}>
query.set(self.text)}
onActivate={onEnter}
/>
{list.as(list => list.map(app => (
)))}
l.length === 0)}>
}