Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- URL="http://alpha.wallhaven.cc/search?categories=111&purity=100&resolutions=1920x1080&sorting=random&order=asc"
- WID_XPATH="//*[@id=\"thumbs\"]/section/ul/li[1]/figure/@data-wallpaper-id"
- WID=`xidel $URL --user-agent="Mozilla/5.0" -e $WID_XPATH`
- if [ $? == 0 ]; then
- FILENAME="wallhaven-${WID}.jpg"
- WALLPAPER_URL="http://wallpapers.wallhaven.cc/wallpapers/full/$FILENAME"
- WALLPAPER_FILE="/media/data/Pictures/$FILENAME"
- wget -c $WALLPAPER_URL -O $WALLPAPER_FILE
- if [ $? == 0 ]; then
- ln -sf $WALLPAPER_FILE "${HOME}/.i3/wallpaper"
- feh --bg-scale $WALLPAPER_FILE
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement