# Use Cronjobs

### To Set Random Wallpaper from UnSplash

To get a random pictures from UnSplash using keywords, and then set the pictures as wallpapers in Cinnamon or Mate, you can use a script file, and call it with crontab.

Here are the [steps from this website](https://youness.net/linux/set-random-wallpapers-unsplash-com-ubuntu) explaining how:

### In Gnome Desktop

```

#!/bin/bash

wget -O /tmp/wallpaper.jpg https://source.unsplash.com/random

gsettings set org.gnome.desktop.background picture-uri file:///tmp/wallpaper.jpg

```

1. Create a script with above code (I’m doing it in /bin folder):

```

cd /bin

sudo nano unsplash.sh

```

2. Ctrl+X, then Y, then Enter, to save the script.

3. Make it executable, and run it:

```

sudo chmod +x unsplash.sh

./unsplash.sh

```

5. Type this command:

```

crontab -e

```

6. Add this line to run script every 5 mins.:

```

*/5 * * * * /bin/unsplash.sh

```

7. Restart cron

```

sudo service cron reload

```

### For Cinnamon Desktop

In addition to what the website says, modify the unsplash.sh like this to get smooth wallpaper transition:

(Replace **`water,nature`** with your own keywords)

```

#!/bin/bash

wget -O /var/tmp/wallpaper-temp.jpg https://source.unsplash.com/1920x1080/?water,nature

mv /var/tmp/wallpaper-temp.jpg /var/tmp/wallpaper.jpg

gconftool set org.cinnamon.desktop.background picture-uri 'file:///var/tmp/wallpaper.jpg'

```

### For Mate Desktop

Use this command in the script instead of the Cinnamon command above:

```

settings set org.mate.background picture-file '/var/tmp/wallpaper.jpg'

```

[⚡️ Follow Freedom Tech](https://nostr.at/npub1fkluklzamwpyn7w8awxzrcqe7z8mldlvthk4gz9kz3vsh6udz62s9qj48l)

#CronJob #RandomWallpaper #CinnamonDesktop #MateDesktop

#Linux #FreedomTech

Reply to this note

Please Login to reply.

Discussion

No replies yet.