import { Astal, Gdk, Gtk } from "ags/gtk4"; import { execApp, getAppIcon, getApps, getAstalApps } from "../scripts/apps"; import { PopupWindow } from "../widget/PopupWindow"; import AstalApps from "gi://AstalApps"; import Pango from "gi://Pango?version=1.0"; import { createState, For } from "ags"; const ignoredKeys = [ Gdk.KEY_Right, Gdk.KEY_Down, Gdk.KEY_Up, Gdk.KEY_Shift_L, Gdk.KEY_Shift_R, Gdk.KEY_Shift_Lock, Gdk.KEY_Left, Gdk.KEY_Return, Gdk.KEY_space ]; export const AppsWindow = (mon: number) => { const [results, setResults] = createState(getApps() as Array); return { const entry = self.get_first_child()!.get_first_child()! .get_first_child()!.get_first_child() as Gtk.SearchEntry; for(const ignoredKey of ignoredKeys) if(key === ignoredKey) return entry.grab_focus(); }}> { setResults(getAstalApps().fuzzy_query(self.text.trim())); }} /> {(app) => ${app.description}` : ""}`.replace(/\&/g, "&") } onActivate={() => { execApp(app); window.close(); }} onClicked={() => { execApp(app); window.close(); }}> } }