Applets for AWN

2007-10-03

I use Linux on the desktop at work. As a Mac owner, I was frustrated by the lack of a usable Dock, until I stumbled across a project called the Avant Window Navigator. Not only is it a cool dock, but it comes with oodles of eye-candy, which I’m a sucker for.

Here’s a screenshot of my dock:

You hear a lot about open source developers who got involved because they needed to “scratch an itch.” I happen to do web development in Java, and I had come to rely on my Gnome CPU Meter applet to tell me when Tomcat had finished deploying (there was always a spike while it was deploying a war file, and then a dropoff when it was finished). I didn’t have that in AWN. Fortunately, you can make applets for it.

So the first applet I created, after a “Hello World” applet and a clock, was a C-based applet called CPU Meter (incidentally, my “Hello World” applet is now part of the awn-extras package). For the CPU Meter, I stole some code from the Gnome System Monitor, mashed it into my Hello World applet, read up on the Cairo Graphics API and GTK+ API, and cobbled together a working CPU load grapher. Later on, another developer came up with an applet called “AwnTop” (a process listing applet), and he merged my stuff in with his stuff. The new applet is now called the AWN System Monitor.

Next, I decided to create a weather applet. All of the other developers had started writing their applets in Python, so I figured it was as good time as any to learn Python! I’ve gotta say I LOVE Python. It’s JavaScript’s simplicity, Shell scripting’s ease-of-use, and Perl’s power… and it’s incredibly easy to read and learn. Here’s a picture of the weather applet in action:

Cool, huh?

Well, I really didn’t intend for this post to be a brag session. I wanted it to be a how-to develop applets for AWN using Python. But now I guess I’ll leave that for the next post!

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.