From 8981800f7173a39c1857a186d644b6207dc82311 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 4 Jan 2024 21:51:22 +0530 Subject: [PATCH] single notification for wallpaper changes --- packages/scripts/chpaper.sh | 2 +- packages/scripts/wallhaven.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/scripts/chpaper.sh b/packages/scripts/chpaper.sh index 3c97d4d..e15008e 100755 --- a/packages/scripts/chpaper.sh +++ b/packages/scripts/chpaper.sh @@ -20,4 +20,4 @@ swww query || swww init convert "$(random_paper)" /tmp/wallpaper.jpg && swww img --transition-step 2 --transition-type random --transition-duration 1 "/tmp/wallpaper.jpg" convert "$(random_paper)" /tmp/lockpaper.jpg -notify-send -r 9897 -i information -t 1000 "Wallpaper" "Wallpaper changed." +notify-send -r 1234 -i information -t 5000 "Wallpaper" "Wallpaper changed." diff --git a/packages/scripts/wallhaven.sh b/packages/scripts/wallhaven.sh index fc11307..54b3982 100755 --- a/packages/scripts/wallhaven.sh +++ b/packages/scripts/wallhaven.sh @@ -67,13 +67,13 @@ if [ -n "${RANGE}" ]; then RANGE="topRange=${RANGE}&" fi -notify-send -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Fetching a list of wallpapers..." +notify-send -r 1234 -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Fetching a list of wallpapers..." URL="${WALLHAVEN_BASE_URL}/search?${TAGS}${CATEGORIES}${PURITY}${SIZE}${RATIOS}${COLORS}${AI_FILTER}${SORTING}${RANGE}" CURL_CMD="${CURL_BASE_CMD} \"${URL}\"" RESULT="$(eval ${CURL_CMD})" NO_OF_IMAGES="$(echo "${RESULT}" | jq -r '.meta.total')" if [ "${NO_OF_IMAGES}" -eq 0 ]; then - notify-send -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "No images available for current configuration." + notify-send -r 1234 -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "No images available for current configuration." exit 1 fi RANDOM_ITEM="$(shuf -i 0-$((NO_OF_IMAGES-1)) -n 1 --random-source=/dev/urandom)" @@ -88,11 +88,11 @@ if [ "${ITEM_PAGE}" -gt 0 ]; then RESULT="$(eval ${CURL_CMD})" fi ID="$(echo "${RESULT}" | jq -r ".data[${ITEM_NUMBER}].id")" -notify-send -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Got ${NO_OF_IMAGES} images. Using image ${ID} from page $((ITEM_PAGE+1)) ..." +notify-send -r 1234 -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Got ${NO_OF_IMAGES} images. Using image ${ID} from page $((ITEM_PAGE+1)) ..." IMAGE_URL="$(echo "${RESULT}" | jq -r ".data[${ITEM_NUMBER}].path")" FILENAME="${IMAGE_URL##*/}" -notify-send -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Downloading image: ${IMAGE_URL}" +notify-send -r 1234 -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Downloading image: ${IMAGE_URL}" curl --silent -L --output-dir "${DIR}" -o "${FILENAME}" "${IMAGE_URL}" -notify-send -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Downloaded image: ${DIR}/${FILENAME}" +notify-send -r 1234 -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "Downloaded image: ${DIR}/${FILENAME}" echo "${DIR}/${FILENAME}"