CPU indicator light for GNOME
I wrote a little GNOME applet to show when the CPU is busy.
Certainly there are at least dozens of different system load indicators, but I don't really like the existing ones, for two usability reasons.
Many load indicators give you a graph showing historical load. The GNOME multiload applet is an example of this. That's fine, but I don't care very much about how busy the machine was in the past. What I mostly want to know is whether it's busy at the moment. That's useful in giving a feeling for the machine: is something unexpected happening? Has your compile finished yet?

In the current GNOME load applet (shown above), the current state of the CPU, which is the most important information, is confined to a one-pixel bar over on the right hand side. In fact, it's not even that, since the bar is only updated every ten seconds or so.
The other approach is something like gkrellm, which shows flcikering indicators of instantaneous load, as well as a graph. But I find it too distracting; load is something you want a background awareness of. It shouldn't be so intrusive as to have moving object in your field of view.

Hardware indicates what I feel is a good interface to do this: it makes a little bit of quiet noise, or lights up a small LED depending on state. Furthermore the LED is in your peripheral vision so you can be aware of it without actually looking at it. You can be easily aware of when your drive is busy and therefore get some idea of what the computer's doing without needing a massive moaning goat on your desktop.
What I would really like is a hardware CPU busy
LED on my
machines. Failing that, we can fake it in software:

This is meant to look like a hardware LED: when the CPU is idle, it's black. When the CPU is flat out, it lights up brightly, in between it is proportionally bright. It responds fairly promptly to changes in actual load, unlike things based on loadavg or that only update every ten seconds. I don't use loadaverage because it's not well suited to modern machines; instead this is the fraction of idle time in the last 0.5 second.
There's a little bit of hysteresis to make it look less flickery and more analog.
I think brightness is probably a better display than say a bar graph. It doesn't cause a visual sensation of motion unless it suddenly switches on or off, which is the most important event. Brightness is only qualitative, not quantitative, but that's highly appropriate for this.
I've been running it for a few days and I like it. You can see out of the corner of your eyes when a compile finishes or when a cron job starts up.
The implementation needs to read /proc/stat (via libgtop) every second, which is a bit unfortunate. It would be nice if it didn't need to wake up so often, but I think the impact is not necessarily much worse than showing a blinking cursor. It doesn't repaint unless the load changed significantly.
This was my first GNOME applet. It turns out to be pretty easy to write, except that the bonobo server registration stuff is just slightly hard to work out. Basically you need to copy the .server file into /usr/lib/bonobo/servers before the applet can get onto the panel at all. In GNOME 1.4 just running the program would make it pop up on some panel.
Probably the worst part of writing this is all the automake voodoo required to link against GNOME; that's deeply unfortunate. I think the only way to get it right is to copy and paste from existing code, and I hate to think how novice programmers would work out some of the automake error messages. I'd like to write predefined SCons builders so you could just say GnomeApplet('blink_applet', 'blink.c') and have it work.
Once it is there you can update the program by just killing the old task. The panel then asks if you want to restart it; if you say yes there then it runs the new version.
Get it and let me know what you think.
You can also get a more recent copy using darcs get http://sourcefrog.net/darcs/blink-applet/
posted Wed 28 Jul 2004 in /software/gnome | link
Archives 2008: Apr Feb 2007: Jul May Feb Jan 2006: Dec Nov Oct Sep Aug Jul Jun Jan 2005: Sep Aug Jul Jun May Apr Mar Feb Jan 2004: Dec Nov Oct Sep Aug Jul Jun May Apr Mar Feb Jan 2003: Dec Nov Oct Sep Aug Jul Jun May
Copyright (C) 1999-2007 Martin Pool.