What I did on my vacation from reality

Home About RTL8187B Laptop Cam Quotes Login

January 31, 2009

Hacking Gnome’s OSD colors under Ubuntu

7:54 pm — Main

I finally decided to hack my mail filter to display a brief summary of incoming non-spam email via OSD, but something had to be done about the vomit/birdshit color scheme that gnome-osd-server was using by default.

Since its configuration GUI, gnome-osd-properties, doesn’t have anywhere you can change the colors, I realized it was probably going to come down to tracking down where the colors are hardcoded and changing them by hand.

Thankfully, the relevant programs were written in Python, and I didn’t have to go compile anything from source — don’t get me wrong, I grew up on the command line, and at least 75% of my time is spent in xterms, but I’ve found that fighting with your package manager is, more often than not, more of a pain in the ass than it’s worth.

Anyway, enough irrelevant crap. The file you’ll want to edit is /var/lib/python-support/python2.5/gnomeosd/server.py.

29
30
bgcolor = "#ffffff"
fgcolor = "#000000"

I had originally written here that you could just kill gnome-osd-server, but that appears to respawn a new process for every OSD message afterwards. Probably not such a great idea. I suggest that, once you get a couple colors you like, you simply bounce the X server (log out, log back in).

Enjoy your new OSD color scheme under Gnome.




January 30, 2009

T-Mobile camera phone image processor

3:56 pm — Main

Screw it, here you go, the magic that makes the cam page work.




Fun with sockets

3:49 am — Main

My mail filter announces incoming mail as it comes in — for spam, it just plays a short wav, one of the sound effects from SOCOM: US Navy Seals. For ham, though, it feeds a brief summary through the speech synthesizer: the sender address, and the subject line (or “No subject”).

When the laptop is up, it acts as my primary MX. When it’s off (e.g., overheated), Google acts as my backup MX, and when my laptop comes back up, it runs fetchmail from cron.

The problem with this is that the speech synth tends to step on itself. I’ll get two or three speech processes, all trying to announce different messages at the same time.

The obvious solution: queue them all up and let a seperate process serialize them via Unix sockets. I could just have each process acquire a lock on the synthesizer, but in case of massive email floods, say, when I’ve been away for a week or two, it’d just cause timeouts and deferrals.

The server I use is here, and the client that feeds it is here. I may or may not update them on the site as I improve the code.