After some playing I’ve managed to write a small gDesklet that correctly reports my battery life and battery/ac status on FreeBSD. It’s pretty damned basic, but works quite well.

Actually writing the display script proved quite straightforward, but getting it to look as I wanted is taking longer. The “Developers Book” on the gDesklets site is good, but still leaves a lot of ground uncovered. For instance, I wanted to add a prefence item for the color of a background color, which is ‘bg-color’ when you write the display item,

However, the preference item that I thought should be

<color lable=”Background color: ” bind=”Dsp.bg.bg-color”/>

produces an error! The solution is to use ‘bg_color’ for the prefence, as follows

<color lable=”Background color: ” bind=”Dsp.bg.bg_color”/>

This may seem obvious but I couldn’t find any mention of it in the developer book and until I asked a question on the discussion forum it seemed impossible.