From d45d9a0b90e070dbcf146c25db7a6023c59d1bb8 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sat, 28 Jan 2023 16:04:17 +0100 Subject: [PATCH] Add a save current wallpaper option. --- .bauke/scripts/desktop-wallpaper.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.bauke/scripts/desktop-wallpaper.ts b/.bauke/scripts/desktop-wallpaper.ts index 932a91a..89b2e6b 100644 --- a/.bauke/scripts/desktop-wallpaper.ts +++ b/.bauke/scripts/desktop-wallpaper.ts @@ -11,12 +11,20 @@ async function main(): Promise { default: 1080, depends: ["unsplash"], }) + .option( + "--save-current ", + "Save the current wallpaper to a different file", + ) .option("--width ", "The width of the image", { default: 1920, depends: ["unsplash"], }) .parse(Deno.args); + if (options.saveCurrent) { + await Deno.copyFile(imagePath, options.saveCurrent); + } + if (options.unsplash) { await downloadImage( `https://source.unsplash.com/random/${options.width}x${options.height}`,