Joachim Breitner

Analog Clock for the Gnome Panel

Published 2006-01-15 in sections English, Digital World.

Since I'm using a thin vertical panel, the normal text-based panel clock provided by Gnome is too wide (I lost sub-10-minutes-precsision). So, for a long while, I was looking for a analog clock applet for the panel. Not having found one, today I thought I'd do it myself.

Since I'm lazy, I searched for a ready analog clock widget, which I found at the ruby-gnome site. That forced my to use ruby (which I haven't yet used), but luckily it was similar enough to python to not have problems with the syntax. Adding that code to a sample Ruby panel applet did the work. I spend most time trying to figure out how to resize the applet correctly. Not sure if I did it correctly, but it seems to work. Comments appreciated.

To install this, you have to put the ruby script somewhere, make it executable and put the bonobo server file to /usr/lib/bonobo/servers, and then adjust the path to the ruby script therein. You need at least the libgnome-applet2-ruby package.

Comments

instead of the canvas, you should have used cairo for drawing the clock. lot less overhead and fancier graphics. :-)
#1 Emmanuele Bassi (Homepage) am 2006-01-16
Well, I took the code that's there, and GnomeCanvas is what I got :-)

Would a Cairo drawing aread support panel tranparency? In that case, I might rewrite that part of the code...
#2 Joachim Breitner (Homepage) am 2006-01-16
Hi JB, I 'apt-get install libpanel-applet2-ruby' and it works. I guess you mis-remembered the library name. Any I now how a cool new clock. Cheers, Kev
#3 Kevin Mark (Homepage) am 2006-01-18
Right, thanks for the hint. I'll just add the hyphen there. Glad you like it!
#4 Joachim Breitner (Homepage) am 2006-01-18
<strong>Trackback:</strong> <a href="http://www.joachim-breitner.de/blog/archives/134-Analog-Clock-for-Gnome,-Take-II.html">Analog Clock for Gnome, Take II</a><br />



A while ago, I made an analog clock for the gnomepanel, using ruby. It worked fined, but I missed the calender functionality of the standard Gnome panel clock. So today, I crudely patched the clock applet from gnome-panel to display a relatively nice
#5 nomeata's mind shares (Homepage) am 2006-03-30
i just use <a href="http://www.yaodownload.com/software-development/components-libraries/skinclock/">Skin Clock</a> to set my laptop time, it's easy!



http://www.yaodownload.com/software-development/components-libraries/skinclock/
#6 mark am 2006-04-21
Thanks for the hint. Do you use Wine to run that, or did you recompile that for gnome?
#7 Joachim Breitner (Homepage) am 2006-04-21
Hi, great applet for Gnome, I've been looking for something like that. The only thing is, that it is too wide and I don't have space for other applets. I removed the clock.set_bg line in clock.applet.rb, now the background color is like that of the panel, but I want to cut down the applet's width just to the clock width. How can I do that? I played around with the ruby file, but have no idea, how it has to be done.
#8 applet width am 2007-01-14
Manual Trackback: http://openwebtech.com/articles/2006/01/18/analog-clock-for-the-gnome-panel
#9 Joachim Breitner (Homepage) am 2006-05-04

Have something to say? You can post a comment by sending an e-Mail to me at <mail@joachim-breitner.de>, and I will include it here.