Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this simple script, take a look at it please:

cd ~/earthwallpaper/
while [  1 ]; do
    while [  $COUNTER -lt 60 ]; do
        wget -O world.jpg
        temp=$(stat -c%s world.jpg)
        if [[ $temp > 1000 ]]
            then    rm world_sunlight_Wallpaper.jpg
                    mv world.jpg world_sunlight_Wallpaper.jpg
        sleep 5
            let COUNTER=COUNTER+1 
    pcmanfm --set-wallpaper=~/earthwallpaper/world_sunlight_Wallpaper.jpg
    sleep 60m

It is downloading picture from web every hour, save file to disk and set up as desktop wallpaper. One file, same name. Downloading and saving works fine, but refreshing wallpaper on desktop works only once - only first time. Next hour it won't change. The picture is saved in some cache and the system won't change it even the file is updated, on the desktop I see only the picture downloaded first time. After system restart, the picture will change.

So is it possible to refresh wallpaper on desktop which has the same name?

share|improve this question
Have you thought about adding your script to a cronjob instead of having the while [ 1 ] loop in it? – AJefferiss Jun 20 '13 at 7:43
up vote 3 down vote accepted

the solution for this problem is addinng this in script:

pcmanfm --wallpaper-mode=center

pcmanfm --wallpaper-mode=stretch

thanx to toxicbreakfast (


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.