A python script that sets the wallpaper from randomly selected images, from a defined folder. Also able to search for a specific wallpaper and set it when you need to. It can filter for images that have or shouldn't have words, keyword in image file name, utilising the grep program.
Also able to set wallpapers based on time, using --time option. If Local time < 4PM, wallpaper is selected from: with "day" in filename. Appropriately for night. It was developed to be run periodically with crontab.
The application does not run continuously in the background, this is on purpose so that it does not use ram and resources. For it to change wallpapers automatically it needs to be setup with crontab. Please see crontab section below.
I have set it to change wallpaper every 10 minutes. Please refer to a crontab manual/wiki, TutorialPoint.com have a simple guide on crontab.
An example:
*/10 * * * * export "$HOME=/home/MyUserName"; export DISPLAY=":0.0"; /home/myUserName/my_scripts/bin/wallpaper.py --time;
On initial launch it will create a configuration file at "~/.config/wallpaper.ini". Please set your wallpaper directory under "wallpaper_dir". Please delete the configuration file when there is an update to the script.
Example:
[Settings]
wallpaper_dir = /home/myUserName/Pictures/walls/_/
My wallpapers have "_night", "_day" or both "_day_night", "bright", "dark", etc in their filename. As result this script can filter them when used with the --time or --search option. It is not a requirement and you don't have to follow this naming convention. However, it is recommended. few examples:
-
Example 1: sunset_dark_night_painting.jpg
-
Example 2: alena-aenami-darknight_night_forest_dark_night_moon_painting.jpg
If PyWal is enabled; wallpaper.py --pywal enabled
, then the selected wallppaer will be passed as an argument when calling wal for colour shcme generation. Also, you can change pywal's backend for colour scheme generation by using the --pywal_backend
argument. You must install the additional backend if not available, they are available in python package repositories, use PIP. Furthermore, you can use random wal colour schemes using the --pywal_random
argument.
wallpaper.py --search="sunset"
wallpaper.py --search="sunset" --exclude="painting"
wallpaper.py --dir="/home/myUserName/Pictures/walls/unfiltered/"
wallpaper.py --wall /home/myUserName/Pictures/walls/unfiltered/2.jpg"
wallpaper.py --time
wallpaper.py --delete
wallpaper.py --info
wallpaper.py --pywal enabled
wallpaper.py --pywal_backend colorz
optional backends:
- haishoku
- wal
- colorz
- schemer2
- colorthief
- Built for linux OS. It uses find, ls, grep and other programs. Uses $HOME and forward slash. Feel free to port to other OS.
Dependencies | Notes |
---|---|
python3 | |
feh | wallpaper utility |
argparse | python package. It maybe available with python standard install. |
configparser | python package. It maybe available with python standard install. |
GPL v3.0