no wallpaper when disconnected from internet (patch attached)

Bug #691602 reported by Kevin Keraudren
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Realtime Sunlight Wallpaper
Fix Committed
Low
Carles Sentis

Bug Description

Hi,

I did some modifications to "callbacks.c" so that :

"get_image.sh" now looks like :

##### BEGIN #####
#!/bin/bash

COUNTER=0
while [ $COUNTER -lt 10 ]; do
 curl http://static.die.net/earth/mercator/1600.jpg > world.jpg
 temp=$(stat -c%s world.jpg)
  if [[ $temp > 1000 ]]
  then rm /home/kevin/.gnome2/RealtimeSunlightWallpaper/gtk-sunlight/*.jpg
   mv world.jpg /home/kevin/.gnome2/RealtimeSunlightWallpaper/gtk-sunlight/sunlight_wallpaper1292601070.jpg
   exit 0
 fi
 sleep 5
 let COUNTER=COUNTER+1
done

exit 1
#####END #####

and I checked the definition of the C "system" function on Wikipedia :
"system [...] will wait until the child process terminates and return its exit value"

hence : I put 10 tries instead of 60 tries : gtk-sunlight is freezing while waiting for ./get_image.sh to answer and if there is nbo connection, it is no use waiting 60*5s=5min, also I introduced exit values.

Then later in callbacks.sh :
   if (system(fname) == 0 ) {
    system(set_wallpaper);
   }

instead of :
   system(fname);
   system(set_wallpaper);

I attached to this bug report a patch (bzr diff > callbacks.diff).
I hope this will help those without a permanent internet connection, or those who simply travel with their laptop.

Kind regards,

Kevin

Revision history for this message
Kevin Keraudren (kevin-keraudren) wrote :
Revision history for this message
Carles Sentis (heepie202) wrote :

Thank you so much for your input.

I'm pretty busy at the moment but revise and implement your changes as soon as.

Regards

Changed in realtimesunlightwallpaper:
assignee: nobody → Carles Sentis (heepie202)
importance: Undecided → Low
Revision history for this message
Carles Sentis (heepie202) wrote :

Your patch has been implemented.

Thank you

Changed in realtimesunlightwallpaper:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.