applets + pixmaps

james, glynn: the situation with some applets is actually a (little bit) bad in terms of pixmap memory use

battstat as an example: in initialise_global_pixmaps, i call gdk_pixmap_create_from_xpm_d a bunch of times to store every pixmap we’ll ever need inside of the x server (on battery, on ac, charging, etc…). this takes up a bunch of pixmap memory but also means that it’s not taking up process memory. the pixmaps are stored only once even if you have many instances (not too often you have more than one battery status applet, though…).

“not taking up process memory” is a tricky one here, though, since all of the pixmaps are stored in text xpm format which is statically linked into the battstat binary. this xpm text is 8470 bytes plus the overhead of maintaining an array of the lines. over all i imagine about 10k is wasted on data that is used on startup then never again.

on the plus side, it can swap out and never needs to come back.

i’m not going to fix this since the entire way we handle this is planned to change soon (ie: svg instead of xpm). let’s see what memory usage is like then…..


at work i’ve been maintaining a cluster of g5 powermacs. doing simple administrative tasks on them was becoming a challenge. i’d either have to do the task 10 times or, if i was lucky and it was a non-interactive sort of thing, write a script to do it for me.

to this end i created keyboardcast.

essentially, you start up keyboardcast and select which windows you want it to type into. then you type. your keystrokes are relayed to all the windows that you selected.

it also has the ability to fire off a bunch of gnome-terminals in a group (for example to ssh into a few different hosts) and start broadcasting to these terminals.

here are some nice screenshots

i really only made it as a tool for myself so it’s a bit rough around the edges (no autotools, requires linux, etc.). none-the-less, code is available here: keyboardcast.