no wallpaper when disconnected from internet (patch attached)
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://
temp=$(stat -c%s world.jpg)
if [[ $temp > 1000 ]]
then rm /home/kevin/
mv world.jpg /home/kevin/
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(
}
instead of :
system(fname);
system(
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
Changed in realtimesunlightwallpaper: | |
status: | New → Fix Committed |
Thank you so much for your input.
I'm pretty busy at the moment but revise and implement your changes as soon as.
Regards