Files
colorshell/ags/runner/plugins/websearch.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

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;