Files
colorshell/ags/runner/plugins/apps.ts
T
retrozinndev 467de2235a chore(runner): try a new approach to show results, make plugins return properties instead of the actual widget
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)
2025-07-23 20:41:23 -03:00

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;