My Unsplash Auto Wallpaper Changer for Linux

A wallpaper changing software that uses Unsplash API to automatically fetch and set beautiful wallpapers on your Linux desktop with auto-start functionality.

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

Welcome to my blog post focusing on my most recent effort—a wallpaper changing software that I spent over 12 hours creating!

ℹ️ Info

This is not your average wallpaper changer program. Instead, it accesses high-quality photographs via the Unsplash API and allows users to define which categories of photos they wish to see.

I’ve combined the program with wget to get photos from the Internet and Nitrogen to install fresh wallpapers on the user’s desktop.

Compatibility and Auto-Start Function

📖 Supported Distributions

Tested and working on:

  • Fedora
  • Ubuntu
  • Arch Linux
📖 Desktop Environments
  • GNOME
  • KDE
  • i3 window manager
  • Other major desktop environments
💡 Tip

The auto-start feature allows the program to activate automatically upon system launch, so you can enjoy new and gorgeous backgrounds every day without having to open the program each time.

Automatic Installation

The wallpaper changing program provides an automated installation function for wget and nitrogen. If these two packages are not currently present on your system, the program will identify and utilize your Linux distribution’s package manager to install them.

Press on a tab to see code
pkexec apt install nitrogen wget -y
pkexec pacman -Sy nitrogen wget -y
pkexec dnf update --refresh -y
⚠️ Warning

The program executes these installation commands via pkexec. If you’re using a window manager or similar basic configuration, you may need to make sure polkit is running.

Storage Management

📖 How Storage Works

One of the app’s best features is that it destroys duplicate photographs if Unsplash delivers them. Users can also choose their display resolution and the amount of disk space they wish to set up for photo downloads.

If the provided storage space fills up (default 9GB), the program will automatically erase older photographs to create place for new ones.

# Set the maximum size of the directory in GB
max_size_gb=9

Configuration Options

📖 Monitor Resolution
# Set the monitor resolution
monitor_resolution="1920x1080"

To find your resolution, run:

xrand
📖 Change Timer
# Wallpaper change interval (default: 30 seconds)
change_timer="30s"
📝 Note

1 minute = 60s, 2 minutes = 120s

📖 Photo Categories

You can customize which categories of photos to download:

queries=(
    "quran"
    "nature"
    "technology"
    "travel"
    "islamic"
    "mosques"
    "Linux"
)

Dependencies

  1. polkit - For authentication (usually pre-installed on GNOME, KDE, XFCE)
  2. nitrogen - For setting wallpapers
  3. wget - For downloading images
💡 Tip

If not installed, the script will auto-install these dependencies.

Uninstallation

# Remove the service
sudo rm -f ~/.local/bin/unsplash_krafi_wallpaper_generator
sudo rm -f ~/.config/autostart/unsplash_krafi_wallpaper_generator.desktop

# Remove downloaded photos
sudo rm -rf ~/Pictures/Wallpapers@krafi.info/

Conclusion

💡 Tip

Why not give it a shot? Put it on your computer, then sit back and let the software refresh your desktop every day with gorgeous, high-quality photographs!

Thank you for using!

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.