evan_tech

Previous Entry Share Next Entry
02:50 am, 18 Feb 06

ghosd lives again

So there's this software called xosd that is used to flash stuff to the screen in X -- y'know, volume changes, song changes, that sort of thing.

Back in 2003 I was frustrated at the low rendering quality (and looking for a project) and I hacked together a prototype of a replacement that used the then-fancy Xft to render antialiased text. Here's a screenshot of it rendering some nice-looking Arabic, and here's a more detailed explanation of how this works. (Please note that I've since figured out some things miswritten in that post, so it's not entirely accurate.)

So tonight I was looking at my rapidly-getting-fancier PowerMate driver* and decided it ought to display the volume on the screen. I started writing Haskell bindings for xosd but couldn't get them to display anything (font issues? Haskell interfering with its spawned threads?). I figured somebody had ought to have improved xosd by now, but queries like [xrender xosd] just bring up my old LiveJournal posts.

So I brought back that old code. Every time I try to hack X I think about how jwz could write the whole program in the time it takes me to figure out which man page I ought to look at, but that still doesn't stop me from having fun.

We still don't have transparency in normal X servers, but we do have much more fun toys to use these days, like Cairo. Here's a screenshot using some nice curves and an image:

Again, not a fake -- it's drawn dynamically by a program. (Mac/Windows users may be scratching their heads here about why this is a hack and not built into the system, and I respond with that X has made us sacrifice glitz and integration for greater flexibility and adaptability.)

The code's available from my monotone repository on neugierig.org, branch org.neugierig.ghosd .

Next up is a higher-level API that does text-drawing, and then a level above that that contains some standard widgets like volume.

(And if you're looking to look at code, my PowerMate/Haskell toy is getting fancier, too.)

* Driver as in the sense of program-that-drives, not in the kernel sense.