4

How to Automatically Set New Wallpapers Using Styli.sh on Linux

 3 years ago
source link: https://www.makeuseof.com/how-to-automatically-set-new-wallpapers-stylish-linux/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to Automatically Set New Wallpapers Using Styli.sh on Linux

By Nitin Ranganath

Published 5 hours ago

Want an attractive Linux desktop but don't have time to find the right wallpaper? Automate the process with Styli.sh.

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.

Learn More: How to Install and Configure Git on Linux

Open up the terminal and run the following command to clone the script:

git clone https://github.com/thevinter/styli.sh
cd 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.

Desktop EnvironmentCommandGNOME./styli.sh -gXFCE./styli.sh -xKDE./styli.sh -kSway./styli.sh -y

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:

./styli.sh

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 1920x1080 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 (3840x2160) 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:

crontab -e

Now, add this line to the end of the file:

@hourly /path/to/script/styli.sh

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.

About The Author

607961b40c2b9-me.png?fit=crop&w=100&h=100

Nitin Ranganath (24 Articles Published)

Nitin is an avid software developer and a computer engineering student developing web applications using JavaScript technologies. He works as a freelance web developer and likes to write for Linux and Programming in his free time.

More From Nitin Ranganath

Subscribe to our newsletter

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

Click here to subscribe

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK