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)
28 lines
716 B
TypeScript
28 lines
716 B
TypeScript
import AstalHyprland from "gi://AstalHyprland";
|
|
import { Runner } from "../Runner";
|
|
|
|
|
|
const searchEngines = {
|
|
duckduckgo: "https://duckduckgo.com/?q=",
|
|
google: "https://google.com/search?q=",
|
|
yahoo: "https://search.yahoo.com/search?p="
|
|
};
|
|
|
|
let engine: string = searchEngines.google;
|
|
|
|
export const PluginWebSearch = {
|
|
prefix: '?',
|
|
name: "Web Search",
|
|
prioritize: true,
|
|
|
|
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;
|