use the .image suffix on downloaded images so chpaper can find them

This commit is contained in:
Adithya 2023-10-15 12:44:51 +05:30
parent 3c14fdb471
commit a724d1ecc8
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ fi
random_paper() {
if [ -d "$DIR" ] ; then
find -L "${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1
find -L "${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png|image)$" | shuf -n1
elif [ -f "$DIR" ] ; then
echo "$DIR"
fi

View file

@ -68,6 +68,6 @@ IMAGE_META=$(eval ${CURL_CMD})
IMAGE_URL="$(echo "${IMAGE_META}" | jq -r '.data.path')"
IMAGE_ID="$(echo "${IMAGE_META}" | jq -r '.data.id')"
FILENAME="wallhaven-${IMAGE_ID}"
curl --silent -L --output "${DIR}/${FILENAME}" "${IMAGE_URL}"
echo "${DIR}/${FILENAME}"
curl --silent -L --output "${DIR}/${FILENAME}.image" "${IMAGE_URL}"
echo "${DIR}/${FILENAME}.image"