diff --git a/src/app.ts b/src/app.ts index f81c976..ae77bcc 100644 --- a/src/app.ts +++ b/src/app.ts @@ -9,7 +9,8 @@ import { PluginMedia, PluginShell, PluginWallpapers, - PluginWebSearch + PluginWebSearch, + PluginKill } from "./runner/plugins"; import { Wireplumber } from "./modules/volume"; import { handleArguments } from "./modules/arg-handler"; @@ -40,6 +41,7 @@ const runnerPlugins: Array = [ PluginApps, PluginShell, PluginWebSearch, + PluginKill, PluginMedia, PluginWallpapers, PluginClipboard diff --git a/src/runner/plugins/index.ts b/src/runner/plugins/index.ts index 9df1fa6..edf759a 100644 --- a/src/runner/plugins/index.ts +++ b/src/runner/plugins/index.ts @@ -4,6 +4,7 @@ import { PluginMedia } from "./media" import { PluginShell } from "./shell" import { PluginWallpapers } from "./wallpapers" import { PluginWebSearch } from "./websearch" +import { PluginKill } from "./kill" export { @@ -12,5 +13,6 @@ export { PluginClipboard, PluginShell, PluginMedia, - PluginWallpapers + PluginWallpapers, + PluginKill }; diff --git a/src/runner/plugins/kill.ts b/src/runner/plugins/kill.ts new file mode 100644 index 0000000..2a79008 --- /dev/null +++ b/src/runner/plugins/kill.ts @@ -0,0 +1,18 @@ +import { execAsync } from "ags/process"; +import { Runner } from "../Runner"; +import { Notifications } from "../../modules/notifications"; + +export const PluginKill = { + prefix: ":k", + handle: () => ({ + title: "Select a client to kill", + closeOnClick: true, + icon: "window-close-symbolic", + actionClick: () => execAsync("hyprctl kill").catch((e) => + Notifications.getDefault().sendNotification({ + summary: "Couldn't kill client", + body: `An error occurred while trying to kill a client! Stderr: ${e}` + }) + ) + } satisfies Runner.Result) +} satisfies Runner.Plugin;