Gnome and Changing Wallpaper by Time Automatically
Yazan: bytan Eylül 15, 2008
Gnome and Changing Wallpaper by Time Automatically
In this article, step by step, we will try to code our own script which changes wallpaper by time using crontab.First thing we have to do is to open gedit and copy/paste the code below into it:
#!/bin/bash
# wallpapers folder
pixfolder=”/home/$USER/wallpaper/
cd $pixfolder# finding pix
files=(./*.jpg)N=${#files[@]}
((N=RANDOM%N))# choosing one of them
randomfile=`echo ${files[$N]} | cut –characters=”1 2″ –complement`# changing wallpaper using gconftool
gconftool-2 -t str –set /desktop/gnome/background/picture_filename “$pix$randomfile”
in terminal, run this command:
sudo cp changing.sh /bin/
sudo chmod +x /bin/changing.sh
Basically, you have a script named changing.sh which changes your wallpaper only when you run it.But we’d like the script to run automatically..This is where we use crontab.
in terminal, run this command to open crontab:
sudo crontab -e
in crontab editor copy/paste this:
*/1 * * * * changing.sh
@reboot changing.sh
then simply press ctrl+x and to save press y..
Thats it.If everythings fine, your wallpaper will be changing once per minute.
So enjoy your Wallpapers


infatuate demiş
waaaooooww, i dont know what can i say, really its perfect, kangıratcıleyşıns :sigara:
AS Chandrashekaran demiş
Fundamentals of Unix/Linux or DOS is poor. You ask to Save the file as “changing.sh”. Where does one save it please? Now you know the knowledge levels on Linux at this End. Be good to have an answer as very keen to go for auto changing background pics
Thanks
A S Chandrashekaran
bytan demiş
A S Chandrashekaran;
Just Save the file whereever you want and then copy it to /bin folder as following the instructions above.