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