Looking for a way to keep your Linux desktop fresh with beautiful, high-quality wallpapers? I’ve created a wallpaper changer that automatically downloads photos from Unsplash and rotates them on your desktop — no manual setup required!
This project accesses high-quality photographs via the Unsplash API and allows you to define which categories of photos you want to see. It runs automatically in the background and changes your wallpaper every 30 seconds.
What You’ll Learn
- How to install and set up the Unsplash Wallpaper Changer
- Configure your monitor resolution and wallpaper categories
- Enable auto-start so it runs on system boot
- Customize storage limits and change intervals
Supported Systems
📖 Compatible Distributions
Tested and working on:
- Ubuntu
- Fedora
- Arch Linux
📖 Compatible Desktop Environments
- GNOME
- KDE Plasma
- XFCE
- i3 window manager
- Other desktop environments supported by Nitrogen
Quick Installation
Run this single command to download and set up the wallpaper changer:
wget -qO- https://gitlab.com/krafi/unsplash-wallpaper-changer-for-linux/-/raw/main/unsplash_krafi_wallpaper_generator | tee unsplash_krafi_wallpaper_generator && chmod +x unsplash_krafi_wallpaper_generator && ./unsplash_krafi_wallpaper_generator
The script will auto-install dependencies (nitrogen, wget) using pkexec if they’re not already installed. Make sure polkit is running on your system.
The script will:
- Check for and install required dependencies
- Create necessary directories
- Set up auto-start on system boot
- Start downloading wallpapers immediately
Configuration Options
Before or after running the script, you can customize the behavior by editing the script variables:
📖 Monitor Resolution
By default, wallpapers are downloaded at 1920x1080. Change this to match your display:
# Set your monitor resolution
monitor_resolution="1920x1080"
To find your current resolution, run:
xrandr
📖 Wallpaper Change Interval
The default interval is 30 seconds. Customize how often wallpapers change:
# Wallpaper change interval (default: 30 seconds)
change_timer="30s"
1 minute = 60s, 2 minutes = 120s, 1 hour = 3600s
📖 Photo Categories
Customize which types of photos to download from Unsplash:
queries=(
"nature"
"technology"
"travel"
"islamic"
"mosques"
"linux"
)
Use specific keywords like “mountains”, “ocean”, “city”, “abstract” for more targeted wallpapers. The script pulls random images matching your categories.
📖 Storage Limit
Control how much disk space is used for storing wallpapers:
# Maximum storage in GB (default: 9GB)
max_size_gb=9
When storage fills up, older wallpapers are automatically deleted to make room for new ones.
Storage Location
All downloaded wallpapers are saved to:
~/Pictures/Wallpapers@krafi.info/
Dependencies
The script automatically installs these if missing:
- nitrogen - Sets wallpapers on your desktop
- wget - Downloads images from Unsplash
- polkit - Handles authentication (usually pre-installed)
Troubleshooting
📖 Wallpaper not changing?
-
Check if nitrogen can set wallpapers manually:
nitrogen --set-zoom-fill ~/Pictures/Wallpapers@krafi.info/ -
Verify the script is running:
ps aux | grep unsplash -
Check for errors in the terminal output
📖 Auto-start not working?
-
Verify the autostart file exists:
ls -la ~/.config/autostart/ -
Make sure your desktop environment supports .desktop autostart files
-
Check system logs for any startup errors
📖 Storage filling up too fast?
Reduce the max_size_gb value or increase the change_timer interval to download fewer images.
How to Update
To update to the latest version:
rm -rf ~/.local/bin/unsplash_krafi_wallpaper_generator
wget -qO- https://gitlab.com/krafi/unsplash-wallpaper-changer-for-linux/-/raw/main/unsplash_krafi_wallpaper_generator | tee unsplash_krafi_wallpaper_generator && chmod +x unsplash_krafi_wallpaper_generator && ./unsplash_krafi_wallpaper_generator
Uninstallation
To remove the wallpaper changer from your system:
# Remove the script
rm -f ~/.local/bin/unsplash_krafi_wallpaper_generator
# Remove auto-start
rm -f ~/.config/autostart/unsplash_krafi_wallpaper_generator.desktop
# Optionally remove downloaded wallpapers
rm -rf ~/Pictures/Wallpapers@krafi.info/
Why not give it a shot? Install it on your computer, then sit back and enjoy fresh, gorgeous wallpapers every day!
Source Code
View the full source code and contribute on GitLab: unsplash-wallpaper-changer-for-linux
Thank you for reading!
Discussion
0 commentsJoin the Discussion
Sign in to post comments and join the conversation.
No comments yet. Be the first to share your thoughts!