✨ 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)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { ResultWidget, ResultWidgetProps } from "../../widget/runner/ResultWidget";
|
||||
import AstalApps from "gi://AstalApps";
|
||||
import { execApp, getAstalApps, lookupIcon, updateApps } from "../../scripts/apps";
|
||||
import { Runner } from "../Runner";
|
||||
|
||||
@@ -9,13 +7,12 @@ export const PluginApps = {
|
||||
// asynchronously-refresh apps list on init
|
||||
init: async () => updateApps(),
|
||||
handle: (text: string) => {
|
||||
return getAstalApps().fuzzy_query(text).map((app: AstalApps.Application) =>
|
||||
new ResultWidget({
|
||||
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",
|
||||
onClick: () => execApp(app)
|
||||
} as ResultWidgetProps)
|
||||
actionClick: () => execApp(app)
|
||||
})
|
||||
);
|
||||
}
|
||||
} as Runner.Plugin;
|
||||
|
||||
Reference in New Issue
Block a user