Random Unsplash Wallpapers For Ubuntu

Youness
Youness
Aug 27, 2017 · 2 min read
“A white coffee mug with “begin” written on it on a wooden table” by Danielle MacInnes on Unsplash

I like to have random wallpapers while working on PC, a kind of window opened to the world. Now add to that a set of wonderful and free pictures from Unsplash, and you’ll need nothing else to stay happy and motivated!

For Windows, there are tools that do that we no big deal, like DMT.

For Ubuntu, I didn’t find such tool, so I’m tweaking something here (that’s Linux power :))

Thanks to Unsplash.it and this post, I have enough help to start. It already uploads random picture and set it as wallpaper.

#/bin/bash wget -O /tmp/wallpaper.jpg https://unsplash.it/2560/1440/?random gsettings set org.gnome.desktop.background picture-uri file:///tmp/wallpaper.jpg

Create a script with above code (I’m doing it in /bin folder):
cd /bin
sudo nano unsplash.sh

Ctrl+X, then Y, then Enter.

Make it executable, and run it:
sudo chmod +x unsplash.sh
./unsplash.sh

You’ll see after some seconds that the wallpaper changes to a new one.
If nothing happens or you lost the previous one, it is may be a problem of connection

Now let’s execute it every 5 minutes using crontab, edit it:
crontab -e

Choose an editor with its number, then add at the end the line:
*/5 * * * * /bin/unsplash.sh

Ctrl+X, then Y, then Enter.

Here is a good explanation of crontab syntax, I quote the part:

The stars represent different date parts in the following order:

  • minute (from 0 to 59)
  • hour (from 0 to 23)
  • day of month (from 1 to 31)
  • month (from 1 to 12)
  • day of week (from 0 to 6) (0=Sunday)

It means every 5 minutes, every hour, every day, and every month.
For the moment this basic script works fine 🙂

If you have any remark or suggestion please add a comment. Thank you.


Originally published at youness.net on August 27, 2017.

)
Youness

Written by

Youness

I came to read, I stayed to write. http://youness.net

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade