467de2235a
returning the results as objects seems to be a better approach, also, the new way of showing results doesn't work for some reason(i didn't discover it yet lol)
19 lines
686 B
TypeScript
19 lines
686 B
TypeScript
import { execApp, getAstalApps, lookupIcon, updateApps } from "../../scripts/apps";
|
|
import { Runner } from "../Runner";
|
|
|
|
export const PluginApps = {
|
|
// Do not provide prefix, so it always runs.
|
|
name: "Apps",
|
|
// asynchronously-refresh apps list on init
|
|
init: async () => updateApps(),
|
|
handle: (text: string) => {
|
|
return getAstalApps().fuzzy_query(text).map(app => ({
|
|
title: app.get_name(),
|
|
description: app.get_description(),
|
|
icon: lookupIcon(app.iconName) ? app.iconName : "application-x-executable-symbolic",
|
|
actionClick: () => execApp(app)
|
|
})
|
|
);
|
|
}
|
|
} as Runner.Plugin;
|