diff --git a/modules/launcher.tsx b/modules/launcher.tsx index 4b42328d..5015b5b5 100644 --- a/modules/launcher.tsx +++ b/modules/launcher.tsx @@ -1,4 +1,4 @@ -import { bind, execAsync, Gio, register, timeout, Variable } from "astal"; +import { bind, execAsync, Gio, GLib, register, timeout, Variable } from "astal"; import { Astal, Gtk, Widget } from "astal/gtk3"; import fuzzysort from "fuzzysort"; import type AstalApps from "gi://AstalApps"; @@ -45,6 +45,17 @@ const getIconFromMode = (mode: Mode) => { } }; +const getEmptyTextFromMode = (mode: Mode) => { + switch (mode) { + case "apps": + return "No apps found"; + case "files": + return GLib.find_program_in_path("fd") === null ? "File search requires `fd`" : "No files found"; + case "math": + return "Type an expression"; + } +}; + const launchAndClose = (self: JSX.Element, astalApp: AstalApps.Application) => { const toplevel = self.get_toplevel(); if (toplevel instanceof Widget.Window) toplevel.hide(); @@ -196,8 +207,12 @@ const Results = ({ entry, mode }: { entry: Widget.Entry; mode: Variable }) shown={bind(empty).as(t => (t ? "empty" : "list"))} > -