cat >> ~/Dropbox/new_installation/wallpaper/mast/wall.sh << END
folder="Dropbox/new_installation/wallpaper/mast/"
rm -f ~/$folder/*.jpg
limit=`wc -l < ~/$folder/list`
my_number=`expr $RANDOM % $limit`
name=`tail -n $my_number ~/$folder/list| head -n 1`
wget -O ~/$folder/pics_list http://www.wallpaperbox.com/Celebrities/$name/
limit=`wc -l < ~/$folder/pics_list`
limit=`expr $limit - 10`
limit=`expr $limit / 2`
my_number=`expr $RANDOM % $limit`
echo $my_number
wget -O ~/$folder/$name.jpg http://www.wallpaperbox.com/Celebrities/$name/$name-$my_number.JPG
gconftool-2 -t str --set /desktop/gnome/background/picture_filename ~/$folder/$name.jpg
END
and a bit improvised version of that is
#!/bin/bash
#folder=`pwd`;
folder="/root/Dropbox/new_installation/wallpaper/celeb";
cd $folder;
rm -f *.jpg;
limit=`wc -l < list`;
my_number=`expr $RANDOM % $limit`;
name=`tail -n $my_number list| head -n 1`;
wget -O pics_list http://www.wallpaperbox.com/Celebrities/$name/ ;
limit=`wc -l < pics_list`;
limit=`expr $limit - 10`;
limit=`expr $limit / 2`;
my_number=`expr $RANDOM % $limit`;
wget -O $name.jpg http://www.wallpaperbox.com/Celebrities/$name/$name-$my_number.JPG;
gconftool-2 -t str --set /desktop/gnome/background/picture_filename $folder/$name.jpg;
No comments:
Post a Comment