Sanely @ Talent : ~ $

Gnome and Changing Wallpaper by Time Automatically

Yazan: bytan Eylül 15, 2008

Gnome and Changing Wallpaper by Time Automatically

Gnome users know that the wallpaper is same on all virtual desktop.To have different wallpapers on different workplace, you may try to use that little script, called Wallpapoz.
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”

Save the file as “changing.sh”

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

3 Yanıt “Gnome and Changing Wallpaper by Time Automatically”

  1. infatuate demiş

    waaaooooww, i dont know what can i say, really its perfect, kangıratcıleyşıns :sigara:

  2. 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

  3. bytan demiş

    A S Chandrashekaran;

    Just Save the file whereever you want and then copy it to /bin folder as following the instructions above.

Yorum Yapın

XHTML: Bu etiketleri kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>