diff --git a/packages/scripts/default.nix b/packages/scripts/default.nix index 720c340..ae78912 100644 --- a/packages/scripts/default.nix +++ b/packages/scripts/default.nix @@ -48,7 +48,7 @@ stdenvNoCC.mkDerivation { wrapProgram $out/bin/power-menu --prefix PATH : ${lib.makeBinPath [libnotify rofi-wayland hyprland]} wrapProgram $out/bin/tmux-sessions --prefix PATH : ${lib.makeBinPath [tmux kitty rofi-wayland]} wrapProgram $out/bin/chpaper --prefix PATH : ${lib.makeBinPath [imagemagick swww]} - wrapProgram $out/bin/wallhaven --prefix PATH : ${lib.makeBinPath [libnotify jq curl libsecret]} + wrapProgram $out/bin/wallhaven --prefix PATH : ${lib.makeBinPath [jq curl libsecret]} wrapProgram $out/bin/youtube --prefix PATH : ${lib.makeBinPath [kitty ytfzf rofi-wayland]} ''; } diff --git a/packages/scripts/wallhaven.sh b/packages/scripts/wallhaven.sh index 9c5bb81..94311b7 100755 --- a/packages/scripts/wallhaven.sh +++ b/packages/scripts/wallhaven.sh @@ -72,7 +72,7 @@ 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 -r 1234 -u normal -a Wallpapers -i information -t 5000 "Wallpapers" "No images available for current configuration." + echo "No wallpapers available for current configuration" >&2 exit 1 fi RANDOM_ITEM="$(shuf -i 0-$((NO_OF_IMAGES-1)) -n 1 --random-source=/dev/urandom)" @@ -86,8 +86,6 @@ if [ "${ITEM_PAGE}" -gt 0 ]; then CURL_CMD="${CURL_BASE_CMD} \"${URL}${SEED}page=$((ITEM_PAGE+1))\"" RESULT="$(eval "${CURL_CMD}")" fi -ID="$(echo "${RESULT}" | jq -r ".data[${ITEM_NUMBER}].id")" -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##*/}" curl --silent -L --output-dir "${DIR}" -o "${FILENAME}" "${IMAGE_URL}"