1
Fork 0

Add a save current wallpaper option.

This commit is contained in:
Bauke 2023-01-28 16:04:17 +01:00
parent 61d7108e5d
commit d45d9a0b90
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 8 additions and 0 deletions

View File

@ -11,12 +11,20 @@ async function main(): Promise<void> {
default: 1080,
depends: ["unsplash"],
})
.option(
"--save-current <file:file>",
"Save the current wallpaper to a different file",
)
.option("--width <width:number>", "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}`,