Wallpaper Automation Tool: WPCTL

Hey,

Today I will come up with a very minimalistic wallpaper automation tool WPCTL. I spend most of my time on the computer. There are not too many options to have fun with while working on the computer. Interesting and colorful photos are one of the favorite entertainment sources for my daily routine. Therefore, I really like auto wallpaper changer programs which surprises me with different photos. I decided to use one of these programs. However, none of them is fulfiled my requirements. I want a wallpaper changer which should be like:

  • It must have beautifull image sources
  • It should be configured easily
  • It should be lightweight and has minimal dependency
  • It should work with multi-monitor and different resolution options
    In a nutshell, I decided to develop a wallpaper changer script according to my requirements.

I started with the image source for my script. There is a website called Unsplash which is a photo sharing website. However, it has a unique feature which differ it from similar apps. It has a very nice and license free API. To keep application similar and with minimum dependency I have written it as a bash scripts. Basically, wpctl script, get image source as argument, read the monitor resolutions and contruct Unsplash url according to them. It download the images from the constructed url and set it as wallpaper using Gnome wallpaper controller. This script also can be add as crontab script. By this, your wallpaper can be changed at the frequency you want. For source there are also 4 options. Details are from readme of Github repository. See you!

Example Wallpaper from Unsplash

wpctl

Wallpaper Control is a minimalist wallpaaper automation tool for linux based on Unsplash

Getting Started

It is working with Unsplash Api

  • Minimalist 100 lines of code zero dependency
  • Auto resolution detection
  • Multi monitor handling
  • Tested on Ubuntu 18.04 with GNOME Desktop

Prerequisities

1
sudo apt-get install wget notify-send

Installing

1
2
3
sudo wget --quiet https://github.com/mozanunal/wpctl/releases/download/0.0.2/wpctl \
-O /usr/local/bin/wpctl && \
sudo chmod +x /usr/local/bin/wpctl

Try the application

1
2
3
4
5
6
7
8
9
10
11
12
user@user:$ wpctl
Please provide a valid wallpaper source
Usage:
wpctl <SOURCE>
random
daily
collection
topic1,topic2
user@user:$ wpctl random
--> Random is selected as source.
https://source.unsplash.com/random/1920x1080
--> From source 'random' wallpaper set. 1920 x 1080

Wallpapers can automatically updated using crontab. Write following command and add line according to your favorite configuration

1
crontab -e

Every hours pick a random wallpaper

1
0 * * * * wpctl random

Every day get daily photo as wallpaper

1
0 10 * * * wpctl daily

Every 15 mins pick a cat image as your wallpaper

1
*/15 * * * * wpctl cat

Every 3 hours pick a blue image as your wallpaper

1
0 */3 * * * wpctl blue

Uninstalling

Remove binaries

1
sudo rm /usr/local/bin/wpctl

Remove picture

1
rm -rf $HOME/wpctl

Authors

  • Mehmet Ozan Ünal

License

  • MIT

Acknowledgments

Paylaş