Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A possible fix for GeekTool image display crashes Apps
After reading a lot about GeekTool crashing, and after having experienced this myself, I found from CrashReporter logs that GeekTool always died in the same OS routine, obviously displaying a picture. I attributed this to the picture being overwritten at the time it is displayed. Based on this assumption, I changed my GeekLog code from:
gm convert .... result.gif; your graphics utility here
to
gm convert .... tmp.gif;  your graphics utility here
mv tmp.gif result.gif
This cured all my frequent crashes. I only have limited UNIX knowledge, but the first version above sure might yield a corrupted image being displayed. In the new version, the mv command will not overwrite the previous version of result.gif. Once result.gif is opened for display, it will stay intact, until it is closed again. If the mv occurs while the file is open, it will be replaced immediately in the directory ... but unlinking of the open file will be deferred, until Geektool closes it.

This technique is not limited to GeekTool; it should always be used when files might get overwritten during parallel processing by some other program. Hope this helps!
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[8,982 views]  

A possible fix for GeekTool image display crashes | 3 comments | Create New Account
Click here to return to the 'A possible fix for GeekTool image display crashes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
My fix to display online pictures w/ Geektool
Authored by: wmscyclone on Jan 13, '05 01:39:02PM
I couldn't quite parse this hint, but I've had the problem of geektool crashing. I had it set to download the local weather radar every 5 minutes and display it on the desktop, using the "Picture" option of geektool to display it from the URL.

In pondering this hint I've now tried this workaround...use geektool to run a shell script to download the jpg to the tmp directory, replace any previous jpg, then use geektool's picture display to show the jpg from the tmp directory.

For the shell command:
curl http://maps.weather.com/web/radar/us_abq_metroradar_large_usen.jpg -o /tmp/wxradar.jpg;
mv /tmp/wxradar.jpg /tmp/geektoolradar.jpg

Shell code broken into 2 lines for display, it should all be on one line. I set it to refresh every 300 seconds. Replace the http:// with the URL for the online picture you wish to display.

For the picture display:
file://Untitled/tmp/geektoolradar.jpg
Replace
Untitled
if your startup hard disk has a different name. I set this one to refresh every 60 seconds, in case it took a little while to download the last image.

So far it's working great.

[ Reply to This | # ]
Don't forget to batch your image retrieval!
Authored by: jqs on Jan 14, '05 10:03:31AM
What a great hint. I too had been suffering with this problem for quite some time and this has fixed it fast! Instead of using multiple commands for donwloading images froma server I suggest either creating a script that handles it or a simple command like (grabs MRTG graphs):

for i in 0 1 2 ; do curl http://your-server-ip/mrtg/host-eth$i-day.png -o /tmp/$i.png; mv /tmp/$i.png /tmp/geek-$i.png; done
That will get the job done nicely.

[ Reply to This | # ]
Don't forget to batch your image retrieval!
Authored by: phil4u2 on Jan 15, '05 10:28:27AM

I've had the same probleem with a webcam inage from my hometown.
Now I've tried your hint. One question, though: I end up with images in my /tmp/ map called geek-0.jpg, geek-1.jpg and geek-2.jpg. Which one do I use in GeekTools (to actually dispay it)???



[ Reply to This | # ]