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() { random_paper() {
if [ -d "$DIR" ] ; then 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 elif [ -f "$DIR" ] ; then
echo "$DIR" echo "$DIR"
fi fi

View file

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