diff options
author | davidpkj <davidpenkow1@gmail.com> | 2024-07-24 16:37:37 +0200 |
---|---|---|
committer | davidpkj <davidpenkow1@gmail.com> | 2024-07-24 16:37:37 +0200 |
commit | a33954c59fe9d8fe889fab077b6612cc029ac3fc (patch) | |
tree | a3035512625aefe79b0973f91bdc7c7ebe302cea /scripts/.local/bin/personal/hdqwd | |
parent | cbfd64346441200e3df8df6ad54fc76c99d25f1c (diff) |
Mega Update: FW16 Space Rice
- Add symlinks to dotfiles in config dir (links to links)
- Switch from neofetch to fastfetch
- Add htop
- Add dynamic colors (polybar, xmonad, qutebrowser)
- Update color management (pywal & friends, alacritty, xorg)
- Minor updates to other files (quality of life)
Diffstat (limited to 'scripts/.local/bin/personal/hdqwd')
-rwxr-xr-x | scripts/.local/bin/personal/hdqwd | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/.local/bin/personal/hdqwd b/scripts/.local/bin/personal/hdqwd new file mode 100755 index 0000000..0d7f709 --- /dev/null +++ b/scripts/.local/bin/personal/hdqwd @@ -0,0 +1,40 @@ +#!/bin/bash + +# A utility to download all images from a specific website give the exact url + +# https://hdqwalls.com/2880x1800/anime-girl-wallpapers/page/2 +# https://hdqwalls.com/search?q=Genshin+Impact&page=2 + +FILE="/tmp/wallpaperhtml" + +download() { + curl -s "$1" > "$FILE" + + IMAGES=$(cat "$FILE" | pup img.thumbnail | grep -o '"http[^"]\+"' | sed 's/\/wallpapers\/thumb/\/download/g' | sed 's/.jpg"$/-2560x1600.jpg/g' | sed 's/"//g') + COUNTER=0 + + for IMG in $IMAGES; do + let COUNTER++ + NAME="$(basename $IMG)" + + echo "[ Download ] ($COUNTER) $NAME" + curl -s "$IMG" > "$NAME" + sleep 2 + done + + echo -e "\nFinished!" +} + +if [[ -z "$1" ]]; then + echo "[ Error ] Please provide a URL" + exit 1 +fi + +if [[ "$1" = "s" ]]; then + IMAGE=$(curl -s "$2" | pup img.d_img_holder | grep -o '"http[^"]\+"' | sed 's/\/wallpapers\/bthumb/\/download/g' | sed 's/.jpg"$/-2560x1600.jpg/g' | sed 's/"//g') + NAME="$(date +"%s")" + curl -s "$IMAGE" > "$NAME.jpg" +else + download "$1" +fi + |