Skip to content

Instantly share code, notes, and snippets.

Last active August 2, 2017 20:47
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
CURL imgur links from a subreddit every so often so you always have a variety of wallpapers :)
cd ~/Pictures/wallpapers && curl | tr '"' '\n' | grep imgur | tee "$$.tmp" | egrep 'http:\/\/\/.*\.jpg' | xargs wget -q -nc
egrep '^' "$$.tmp" | xargs -L1 ~/Pictures/wallpapers/
rm "$$.tmp"
# Credit /u/Molozonide
0 10 * * * /Users/USER/Pictures/wallpapers/ &> /dev/null
curl "$1" \
| grep 'thumb-title' \
| sed 's/^.*data-src="//' \
| sed 's/" data-index=".*>$//' \
| sed 's/s././' \
| xargs -L1 wget -q -nc
# Credit /u/Molozonide

Reddit Wallpapers

A script that will pull from so you always have variety.

Credit goes to /u/Molozonide who supplied the script :D I just fixed it up and put it nicely in one place.


  1. Go to terminal and cd ~/Pictures/ && mkdir wallpapers so you have a place for your wallpapers
  2. Take the files and and move them to ~/Pictures/wallpapers
  3. In terminal edit your cron jobs by doing crontab -e and editing the file to have the following:

0 10 * * * /Users/USER/Pictures/wallpapers/ &> /dev/null

This will set it up so that it runs everyday at 10 AM. I also set it up so it won't mail you. Also note it's important to have a newline at the end of cron.

  1. Verify that the cron job is running by doing crontab -l
  2. Go to your Desktop, select Change Desktop Background...
  3. In the bottom right hit the + button, select the wallpapers folder and then check Change picture interval.

Note: If you get Permission denied for running or, you may need to change the permissions (chmod 777)


  • If you want to customize the /wallpapers directory, just remember to update
  • You can also customize the subreddit to pull from by changing the curl url

Other awesome subreddits to pull from

Copy link

On running the script, I'm getting wget: missing URL

Copy link

augbog commented Oct 14, 2015

@scorpionhiccup when you say running the script, are you running or are you running You have to run which calls the latter (ideally I should just merge this into one file -- will do that some time when I can)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment