Linux Random Change Wallpaper

Source: Internet
Author: User

Mint's default wallpaper looks a bit uncomfortable, so I want to change a few pictures to see.

Looking for a meeting, did not see the same as windows can randomly cut the function of the wallpaper, all wrote a script implementation.


The system is linux-mint17.3, but should all be generic, the script is as follows:


Yibo-mint Desktop # vim ran_wallpaper.sh #!/bin/bash wallpaper_path= "/data/wallpaper" # Wallpaper path sleep_time=1 # change interval unit seconds fin D $wallpaper _path-name ' * * ' | Cat >/tmp/list # Get a picture List img_range_max= ' Cat/tmp/list | Wc-l ' # Gets the number of images used to set the random range while true does n=$ ((random% $img _range_max+1) # Gets the random number img_path= ' awk nr== $n/tmp/list ' # get The full path of the wallpaper gsettings set org.gnome.desktop.background picture-uri file://$img _path # change wallpaper command sleep $sleep _timedone

p.s. Picture name don't have a space ah what's oh, otherwise it will go wrong.

Remember to execute permissions on the script, and the shutdown script can only use PS to find the process ID, and then kill/Bay stretched out

Again p.s. Change the wallpaper, is need to have the graphical interface, nonsense ~

This article is from the "Gentle Snow" blog, please be sure to keep this source http://dangyibo.blog.51cto.com/4219248/1854650

Linux Random Change Wallpaper

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.