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:
retrozinndev
2025-07-23 20:41:23 -03:00
parent 69b098b6bd
commit 467de2235a
9 changed files with 278 additions and 242 deletions
+10 -12
View File
@@ -1,7 +1,7 @@
import AstalHyprland from "gi://AstalHyprland";
import { ResultWidget, ResultWidgetProps } from "../../widget/runner/ResultWidget";
import { Runner } from "../Runner";
const searchEngines = {
duckduckgo: "https://duckduckgo.com/?q=",
google: "https://google.com/search?q=",
@@ -15,15 +15,13 @@ export const PluginWebSearch = {
name: "Web Search",
prioritize: true,
handle: (search: string): ResultWidget => {
return new ResultWidget({
icon: "system-search-symbolic",
title: search || "Type your search...",
description: `Search the Web`,
onClick: () => AstalHyprland.get_default().dispatch(
"exec",
`xdg-open \"${engine + search}\"`
)
} as ResultWidgetProps);
}
handle: (search) => ({
icon: "system-search-symbolic",
title: search || "Type your search...",
description: `Search the Web`,
actionClick: () => AstalHyprland.get_default().dispatch(
"exec",
`xdg-open \"${engine + search}\"`
)
})
} as Runner.Plugin;