Created
December 19, 2018 20:44
Revisions
-
lesthack created this gist
Dec 19, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #/bin/bash # Paths home_path="/home/user" wallpapers_path="$home_path/Wallpapers" # Test Internet Connection wget -q --spider http://google.com if [ $? -eq 0 ]; then echo "Download to Internet" wallpaper_name=`date +"%s%3N"`.jpg wget -O "$wallpapers_path/$wallpaper_name" https://unsplash.it/2560/1440/?random else echo "Set last wallpaper" wallpaper_name=`ls -t $wallpapers_path | head -1` fi ln -sf "$wallpapers_path/$wallpaper_name" /tmp/wallpaper.jpg gsettings set org.gnome.desktop.background picture-uri "file:///tmp/wallpaper.jpg"