From 9c1cc00965170b85146ddcdaff9eeb522e1a8d48 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 1 Mar 2025 22:01:55 +1100 Subject: launcher: wallpaper action --- src/modules/launcher/actions.tsx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/modules') diff --git a/src/modules/launcher/actions.tsx b/src/modules/launcher/actions.tsx index 75f1092..a8c5d0a 100644 --- a/src/modules/launcher/actions.tsx +++ b/src/modules/launcher/actions.tsx @@ -1,6 +1,8 @@ import { Apps } from "@/services/apps"; import type { IPalette } from "@/services/palette"; import Schemes from "@/services/schemes"; +import Wallpapers from "@/services/wallpapers"; +import { basename } from "@/utils/strings"; import { notify } from "@/utils/system"; import { setupCustomTooltip, type FlowBox } from "@/utils/widgets"; import { execAsync, GLib, readFile, register, type Variable } from "astal"; @@ -218,6 +220,28 @@ const Scheme = ({ name, colours }: { name: string; colours: IPalette }) => ( ); +const Wallpaper = ({ path, thumbnail }: { path: string; thumbnail?: string }) => ( + + + +); + @register() export default class Actions extends Widget.Box implements LauncherContent { #map: ActionMap; @@ -249,6 +273,10 @@ export default class Actions extends Widget.Box implements LauncherContent { const scheme = args[1] ?? ""; for (const { target } of fuzzysort.go(scheme, Object.keys(Schemes.get_default().map), { all: true })) this.#content.add(); + } else if (action === "wallpaper") { + const wallpaper = args[1] ?? ""; + for (const { obj } of fuzzysort.go(wallpaper, Wallpapers.get_default().list, { all: true, key: "path" })) + this.#content.add(); } else { for (const { target } of fuzzysort.go(action, this.#list, { all: true })) this.#content.add(); -- cgit v1.2.3-freya