♻️ ags(runner): organize files separately from the main shell stuff

This commit is contained in:
retrozinndev
2025-03-12 22:11:18 -03:00
parent 65143468c5
commit 52cfd114d7
13 changed files with 62 additions and 109 deletions
+20
View File
@@ -0,0 +1,20 @@
import AstalHyprland from "gi://AstalHyprland";
import { ResultWidget, ResultWidgetProps } from "../../widget/runner/ResultWidget";
import AstalApps from "gi://AstalApps";
import { getAstalApps } from "../../scripts/apps";
import { Runner } from "../Runner";
export const PluginApps = {
// Do not provide prefix, so it's always ran.
name: "Apps",
handle: (text: string) => {
return getAstalApps().fuzzy_query(text).map((app: AstalApps.Application) =>
new ResultWidget({
title: app.get_name(),
description: app.get_description(),
icon: app.iconName,
onClick: () => AstalHyprland.get_default().dispatch("exec", app.get_executable())
} as ResultWidgetProps)
) || null;
}
} as Runner.Plugin;