tagged gaim, gtk, mac, nerd, openbsd, perl, x40, and commented on once
anyway, back to the show.
a few weeks ago i switched back to using openbsd on an x40 and am no longer using mac os x on a powerbook for my workstation.
i don't really have many bad things to say about mac os x or the powerbook, i just wanted to switch back to openbsd because i've been away from it for so long. i picked up a new x40 on ebay for the same price as i sold my old one, and this new one has more memory, a faster processor, integrated bluetooth and an a/b/g wireless card (more on that in a second.)
there are some things i already miss from mac os x, namely quicksilver, growl, and itunes. the hard drive in the x40 is half the capacity of the powerbook's so i can't carry around all of my music (not that i could anyway since a lot of it was bought from itms and is locked with drm.) the bluetooth support was excellent and integrated nicely between my phone(s), address book and ical. however, i've still got my new imac that i'm running itunes on now, and will use for imovie, parallels and anything else i must have a fancy desktop for.
i don't miss the sound of the powerbook's fan always being on, or the scorching temperature of the case at all times. it was usually so hot that my palms would actually start sweating on the palm wrest while typing. i don't miss the quirkiness of its x11 server (no integration with command+tab or the like) or the dozens of zombie X processes that liked to accumulate over time. i don't miss the stupid problem with tcsh under mac os that would cause 100% cpu usage (i thought i had fixed it but the fix had side effects.) i don't miss the ridiculous memory usage and random 20-second memory/disk swapping sessions, and the weekly close- everything- and- logout- and- log- back- in- but- hey- at- least- it's- not- a- reboot to get things responding normally again. i don't miss the fucking beachball! and i don't miss the lack of dedicated pageup/pagedown keys, or complete lack of end/home/insert/delete keys.
when i first booted the new x40, the bios spit out a pci resource conflict and the internal wireless card wouldn't work under openbsd. it'd give an initialization error and then slow the whole system down, as if there was an interrupt problem.
i have no idea why the ibm minipci card doesn't work in the ibm thinkpad it came in. i yanked the card out and was using a pcmcia wavelan card (oh yeah, pcmcia, something else the powerbook lacked) until i picked up an intel pro/wireless 2200bg card (iwi) on ebay.
once i was up and running in openbsd (all of 10 minutes) i wanted to try out some different window managers since i had grown somewhat tired of ratpoison. i tried ion, wmii, cwm, and a bunch of others and they all suck. well, maybe suck is a harsh word, but when a window manager needs a configuration file written just to be used normally, or i need to read an entire manual just to figure out how to do basic things like move and resize windows, things are getting out of hand.
so, i went back to aewm, something i used a long time ago and loved hacking on since the entire window manager is 6 c files and 1 include file. it uses practically no memory and it has a separate, optional application launcher and task bar. the basic operations of moving and resizing windows are as one would expect, and it natively supports virtual desktops.
the first thing i noticed (or, rather, remembered from my previous use) when i was back in openbsd was that the fonts sucked in x11. i loved the way fonts looked in mac os x; anti-aliased but not so much that it was blurry, and big enough to be readable but not huge on a 1024x768 screen. i looked into how to do this in x11 and after trudging through a bunch of stupid howto's, mailing list postings, and other random documentation, was able to make things much better with just a few minor changes:
- install the mscorefonts port which includes arial and verdana, which are used by most websites
- most newer applications (and anything using gtk+2) use xft for font rendering, and xft is configurable by ~/.fonts.conf. my fonts.conf enables sub-pixel rendering for clearer anti-aliasing on the x40's lcd, enables font hinting for small text, uses arial in place of helvetica and lucida, and forces xft to ignore non-ttf fonts that linger in /usr/X11R6/lib/fonts/
- change the x server resolution from the default 75 to 96 dpi (the x40's is about 105, but things looked weird at that size so i went to 96). this makes things show up a bit bigger, especially in firefox, and makes font sizes appear in x11 relatively the same size as they did in mac os. since i'm not using an xorg.conf (gee, a config-less x server, that only took how many years?), i added "-dpi 96" to the server options in /etc/X11/xdm/Xservers
- because the increased dpi will make fonts bigger, they looked a bit too big in some gtk apps (i'm using the clearlooks gtk 2 theme which is apparently the default on most leenucks distributions, and it's in the openbsd ports tree), so i bumped the fonts down by adding "gtk-font-name = "Sans 8"" to my ~/.gtkrc-2.0 file.
and now things are looking pretty, and correctly sized (which is useful for me doing web development).
the next most important things i needed from mac os x were growl and quicksilver.
growl was useful for me because i'd often be in other workspaces when someone would send me a message on jabber. i'd hear the sound from adium and the message would show on the top right corner of my screen, pause long enough for me to read it, and then disappear, without any interaction from me. no big popup that steals focus, no dialog box that requires me hitting "ok", semi-transparent so i can still read my current window below it, and visual in case i couldn't hear the chime from adium. if the message wasn't important, i didn't need to switch away from my current workspace to look at adium.
and of course, a big plus with growl is that so many mac os x applications support it. adium let me know when messages arrived, firefox notified me when downloads finished, itunes showed me the album art, artist, and song title of the song that just started playing, and my own imap mailbox checker gave me the sender's name and subject of new e-mail messages; all through growl.
i looked around on sourceforge and freshmeat and found that kde has a notification-type system, but i don't want to install kde just to use it. that's probably why there isn't a prominent growl-type system for x11; it'd either use gnome or kde, so half of the applications out there wouldn't want to link in a bunch of crap just for notifications. growl is just one self-contained library that developers can link to for support.
so as usual, i wrote my own; sheepishly named "meow" since it's a stripped down copycat of growl (boy that's a lot of animal references). i wrote it in perl (though i might rewrite in c later) with gtk+2 bindings, assuming that even kde and non-desktop-environment users have gtk installed. it doesn't look as pretty as growl, and i can't do transparent/shaded windows, but it's a start.
the nice thing about it is that it works by simply creating a fifo socket at ~/.meow (or wherever the MEOW_SOCK environment variable points to) and listening for simple plain-text messages (though simple html-like formatting for bold/italics is passed directly through to pango) from clients. the message can optionally contain a path to an icon to display, like gaim below. this means that applications don't need to link to anything to use it or have an xml library to compose messages, they just use standard file operations to open the fifo, print a string to it, and close it.
the initial code is in the usual place, though there are a lot of TODO's and XXX's in there. i modified my imap biff to support meow as well as growl, and the code was all of:
sysopen(MEOW, ($ENV{"MEOW_SOCK"} ? $ENV{"MEOW_SOCK"}
: $ENV{"HOME"} . "/.meow"), O_WRONLY|O_NONBLOCK) or
die "can't write to meow socket (not running?)";
print MEOW "||" . "New message in <b>" . $folder . "</b>\n"
. "From <b>" . $from . "</b>:\n"
. $subject . "\n";
close(MEOW);
notice the lack of xml and library calls. i started to write a gaim plugin to send messages and presence changes to meow, but enabling perl support in openbsd's gaim port does not work (and brad@ didn't respond to my question) so i can't really do much with gaim yet (i made the screenshot by just echoing to the fifo from a shell.)
as for quicksilver, i didn't really use the advanced features of it like all of the chained actions and dragging and dropping, but just being able to hit command+space and type in the first few letters of an application or path/file (though lacking mac os x's "open" command kind of makes the path/file part moot) was a real time saver. i hope something like this already exists for x11 since it seems so trivial.

i like how you called it meow, because it wasn't as "powerful" as growl. you're smrt.