From bcbd08c225f638c151c5311fc89cb4c0408450ca Mon Sep 17 00:00:00 2001 From: moons Date: Wed, 5 Aug 2026 05:04:22 +0900 Subject: [PATCH] wallpaper vicinae --- .../linux-wallpaperengine/home/nixos.nix | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/modules/applications/linux-wallpaperengine/home/nixos.nix b/modules/applications/linux-wallpaperengine/home/nixos.nix index a4519ad..cb019d7 100644 --- a/modules/applications/linux-wallpaperengine/home/nixos.nix +++ b/modules/applications/linux-wallpaperengine/home/nixos.nix @@ -61,6 +61,33 @@ let ''; }; + mkVicinaeScript = + { + name, + title, + description, + command, + mode ? "compact", + message ? null, + }: + { + name = "vicinae/scripts/wallpaper-engine/${name}"; + value = { + executable = true; + text = '' + #!${lib.getExe pkgs.bash} + # @vicinae.schemaVersion 1 + # @vicinae.title ${title} + # @vicinae.description ${description} + # @vicinae.mode ${mode} + # @vicinae.icon 🖼️ + + ${lib.getExe controller} ${lib.escapeShellArg command} + ${lib.optionalString (message != null) "printf '%s\\n' ${lib.escapeShellArg message}"} + ''; + }; + }; + launcher = pkgs.writeShellApplication { name = "linux-wallpaperengine-launcher"; runtimeInputs = [ @@ -115,6 +142,50 @@ assert lib.assertMsg (builtins.elem scaling [ pkgs.linux-wallpaperengine ]; + xdg.dataFile = builtins.listToAttrs [ + (mkVicinaeScript { + name = "reload"; + title = "Reload Wallpaper Engine"; + description = "Restart the active Wallpaper Engine background"; + command = "restart"; + message = "Wallpaper Engine reloaded"; + }) + (mkVicinaeScript { + name = "next"; + title = "Next Wallpaper Engine Wallpaper"; + description = "Switch to the next configured Wallpaper Engine background"; + command = "next"; + message = "Switched to the next Wallpaper Engine wallpaper"; + }) + (mkVicinaeScript { + name = "previous"; + title = "Previous Wallpaper Engine Wallpaper"; + description = "Switch to the previous configured Wallpaper Engine background"; + command = "previous"; + message = "Switched to the previous Wallpaper Engine wallpaper"; + }) + (mkVicinaeScript { + name = "list"; + title = "List Wallpaper Engine Wallpapers"; + description = "Show the configured Wallpaper Engine backgrounds"; + command = "list"; + mode = "fullOutput"; + }) + (mkVicinaeScript { + name = "current"; + title = "Current Wallpaper Engine Wallpaper"; + description = "Show the active Wallpaper Engine background"; + command = "current"; + }) + (mkVicinaeScript { + name = "stop"; + title = "Stop Wallpaper Engine"; + description = "Stop Wallpaper Engine for this session"; + command = "stop"; + message = "Wallpaper Engine stopped"; + }) + ]; + systemd.user.services = lib.optionalAttrs hasWallpapers { linux-wallpaperengine = { Unit = {