From ec2016c6d1b132aa4cc0fb1077e8096c6bbd6f7c Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 18 Jul 2025 17:05:43 +0300 Subject: [PATCH] Update the wallpaper even if the image file already exists --- .local/bin/get-nasa-apod | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.local/bin/get-nasa-apod b/.local/bin/get-nasa-apod index f069a4d..bd69600 100755 --- a/.local/bin/get-nasa-apod +++ b/.local/bin/get-nasa-apod @@ -23,16 +23,16 @@ outfile="${WALLPAPERS}/${filename}" if [ -f "${outfile}" ]; then echo "Target file already exists" - exit 0 +else + tempfile="$(mktemp)" + curl \ + --location \ + --output "${tempfile}" \ + --silent \ + "${picture_url}" + mv "${tempfile}" "${outfile}" fi -tempfile="$(mktemp)" -curl \ - --location \ - --output "${tempfile}" \ - --silent \ - "${picture_url}" -mv "${tempfile}" "${outfile}" ln \ --force \ --symbolic \