Unsplash Auto Wallpaper Changer for Linux

Learn how to set up an automatic wallpaper changer on Linux that fetches high-quality photos from Unsplash every 30 seconds. Complete installation guide with auto-start functionality.

Rafi
Written by Rafi
📅
Published March 1, 2023
⏱️
Read Time 2 min
📊
Difficulty Intermediate

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!

ℹ️ Info

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
⚠️ Warning

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:

  1. Check for and install required dependencies
  2. Create necessary directories
  3. Set up auto-start on system boot
  4. 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"
📝 Note

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"
)
💡 Tip

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:

  1. nitrogen - Sets wallpapers on your desktop
  2. wget - Downloads images from Unsplash
  3. polkit - Handles authentication (usually pre-installed)

Troubleshooting

📖 Wallpaper not changing?
  1. Check if nitrogen can set wallpapers manually:

    nitrogen --set-zoom-fill ~/Pictures/Wallpapers@krafi.info/
    
  2. Verify the script is running:

    ps aux | grep unsplash
    
  3. Check for errors in the terminal output

📖 Auto-start not working?
  1. Verify the autostart file exists:

    ls -la ~/.config/autostart/
    
  2. Make sure your desktop environment supports .desktop autostart files

  3. 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/
💡 Tip

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!

Knowledge Check

Test your knowledge about Unsplash Auto Wallpaper Changer for Linux

Discussion

0 comments
Reading Progress
4 min left 0%
Welcome back! Sign in to join the discussion.

Please verify your email to sign in.

Enter the 6-digit code from your verification email.

Didn't receive the email?

Remember your password?

Create an account to comment and join the community.
Letters, numbers, and underscores only

Check your email! We've sent a verification code.

Enter the 6-digit code to complete your registration, or click the link in your email.

Didn't receive the email?

Wrong email?

Enter your email address and we'll send you a code to reset your password.

Remember your password?

Enter the 6-digit code from your email and create a new password.

Didn't receive code?

Welcome aboard!

Your account has been created successfully.

Welcome back! Sign in to join the discussion.

Please verify your email to sign in.

Enter the 6-digit code from your verification email.

Didn't receive the email?

Remember your password?

Create an account to comment and join the community.
Letters, numbers, and underscores only

Check your email! We've sent a verification code.

Enter the 6-digit code to complete your registration, or click the link in your email.

Didn't receive the email?

Wrong email?

Enter your email address and we'll send you a code to reset your password.

Remember your password?

Enter the 6-digit code from your email and create a new password.

Didn't receive code?

Welcome aboard!

Your account has been created successfully.