perf(ags/runner): better code for runner, show results from multiple plugins, use interface to make plugins and more perfomance implementations

This commit is contained in:
retrozinndev
2025-03-12 14:11:42 -03:00
parent 0ce13b47be
commit f0cec3ff84
7 changed files with 244 additions and 220 deletions
+14
View File
@@ -9,8 +9,19 @@ import { Time, timeout } from "astal/time";
import { OSD, OSDModes, setOSDMode } from "./window/OSD";
import { ControlCenter } from "./window/ControlCenter";
import { Runner } from "./window/Runner";
import { PluginApps } from "./scripts/runner/apps";
import { PluginShell } from "./scripts/runner/shell";
import { PluginWebSearch } from "./scripts/runner/websearch";
let osdTimer: (Time|undefined);
const runnerPlugins: Array<Runner.Plugin> = [
new PluginApps(),
new PluginShell(),
new PluginWebSearch()
];
App.start({
instanceName: "astal",
requestHandler(request: string, response: (result: any) => void) {
@@ -26,6 +37,9 @@ App.start({
Wireplumber.getDefault().getDefaultSink().connect("notify::volume", () =>
!Windows.isVisible(ControlCenter) && triggerOSD(OSDModes.SINK));
console.log(`[LOG] Adding runner plugins`);
runnerPlugins.map(plugin => Runner.addPlugin(plugin));
}
});