diff --git a/config/ags/launcher/ui/Launcher.tsx b/config/ags/launcher/ui/Launcher.tsx new file mode 100644 index 0000000..f10563a --- /dev/null +++ b/config/ags/launcher/ui/Launcher.tsx @@ -0,0 +1,64 @@ +import { App, Astal, Gtk, Gdk } from "astal/gtk4" +import { Variable } from "astal" + +function hide() { + App.get_window("launcher")!.hide() +} + +export default function Launcher(monitor: Gdk.Monitor) { + const { CENTER } = Gtk.Align + const apps = new Apps.Apps() + const width = Variable(1000) + + const text = Variable("") + const list = text(text => apps.fuzzy_query(text).slice(0, MAX_ITEMS)) + const onEnter = () => { + apps.fuzzy_query(text.get())?.[0].launch() + hide() + } + + return { + text.set("") + width.set(self.get_current_monitor().workarea.width) + }} + onKeyPressEvent={function (self, event: Gdk.KeyEvent) { + if (event.get_keyval() === Gdk.KEY_Escape) + self.hide() + }}> + + w / 2)} expand onClick={hide} /> + + + + text.set(self.text)} + onActivate={onEnter} + /> + + {list.as(list => list.map(app => ( + + )))} + + l.length === 0)}> + + + + + + w / 2)} expand onClick={hide} /> + + +} diff --git a/config/ags/launcher/ui/components/calc.tsx b/config/ags/launcher/ui/components/calc.tsx new file mode 100644 index 0000000..e69de29 diff --git a/config/ags/launcher/ui/components/large.tsx b/config/ags/launcher/ui/components/large.tsx new file mode 100644 index 0000000..e69de29 diff --git a/config/ags/launcher/ui/components/list.tsx b/config/ags/launcher/ui/components/list.tsx new file mode 100644 index 0000000..e69de29 diff --git a/config/ags/launcher/ui/components/medium.tsx b/config/ags/launcher/ui/components/medium.tsx new file mode 100644 index 0000000..e69de29 diff --git a/config/ags/launcher/widget/Bar.tsx b/config/ags/launcher/widget/Bar.tsx deleted file mode 100644 index c2db8c5..0000000 --- a/config/ags/launcher/widget/Bar.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { App, Astal, Gtk, Gdk } from "astal/gtk4" -import { Variable } from "astal" - -const time = Variable("").poll(1000, "date") - -export default function Bar(gdkmonitor: Gdk.Monitor) { - const { TOP, LEFT, RIGHT } = Astal.WindowAnchor - - return - - - - - - - -}