Linux is widely known among enthusiasts for the productivity and the control it offers to its users. However, one of the things that often goes unnoticed is its flexibility in terms of customizations.
Speaking of customizations, the wallpaper is a simple yet fundamental aspect of the Linux desktop that can make or break its aesthetics. Finding the perfect wallpaper manually can be tough. So why not let a simple script take the pain away? Let’s find out more about this script in detail.
What Is Styli.sh?
Styli.sh is a simple bash script that you can run on the Linux terminal to discover and set new wallpapers from Unsplash and various subreddits of your choice. Just specify the type of wallpapers you’re looking for, and this script will automatically set a random wallpaper related to your search term.
Since it is just a bash script, you don’t need to install any packages or dependencies. However, you will need to have Git installed on your machine to clone the script from the remote repository and run it.
Open up the terminal and run the following command to clone the script:
git clone https://github.com/thevinter/styli.sh
Setting Wallpapers With Styli.sh
By default, Styli.sh works natively on popular Linux desktop environments such as GNOME, KDE, XFCE, and Sway window manager. Refer to the table given below and run the appropriate command on the terminal to apply a random wallpaper from Unsplash.
For other desktop environments, you’ll need to have feh installed on your Linux system for Styli.sh to work. Feh is a lightweight X11 image viewer aimed mostly at console users. You can use it to set wallpapers via the command line. You can set a new wallpaper using feh and Styli.sh just by executing the script like this:
To search for a particular wallpaper from Unsplash using a search term, you can use the -s flag while executing the script. For multiword search terms, enclose the words in double quotes. Here’s an example that elucidates the usage of the -s flag:
./styli.sh -s space
./styli.sh -s "snowy mountain"
Fetching Wallpapers From Subreddits
To set a random wallpaper from your favorite subreddit, use the -r flag while executing the script. Pass a valid subreddit name after the flag and Styli.sh will automatically search through that subreddit and set a random image as your wallpaper. Here’s how you can do that:
./styli.sh -r wallpapers
Custom Wallpaper Height and Width
By default, Styli.sh sets a random image with the resolution 1920×1080 as your wallpaper. While this resolution is suitable for most of the 1080p displays out there, you can also set custom width and height using the -w and -h flags respectively.
If you’re using a 4K monitor, you can set wallpapers in 4K resolution (3840×2160) using the command given below:
./styli.sh -w 3840 -h 2160
It is not necessary to use both flags for the script to work. Using just one of the flags will automatically scale the image to the proper aspect ratio.
New Wallpapers Every Hour With crontab
Cron is a Linux command that you can use to schedule the execution of commands or tasks sometime in the future repeatedly. Using this, you can change your desktop wallpaper weekly, daily, or even hourly.
You can set up a new cron job using crontab with the command given below:
Now, add this line to the end of the file:
Be sure to change /path/to/script to the actual path where you cloned the script. This will set a random wallpaper every hour. To customize or change this behavior, make sure to use the appropriate flags as per your requirements.
Make Your Linux Experience Unique
Having a gorgeous wallpaper sounds great, but what if you could have multiple variants of the same wallpaper for different times of the day. Sounds good? Take your Linux desktop to a different level with dynamic wallpapers today.
Want to completely transform the look and feel of your Linux desktop? Here’s how you can set up dynamic wallpapers.
About The Author