Skip to content
Archive of entries posted on October 2006

fortune for xscreensaver for OS X

I love that jwz ported XScreenSaver to OS X at about the same time I moved to OS X for my laptop.  I got to keep all the screen savers I use and have used over the past decade or so.  Especially some of the cooler GL based ones.  (Its also nice that someone ported rss-glx as well, but that’s a different story.)  The only piece XScreenSaver is missing is the controller to randomly call only selected hacks.  Luckily, RandomExtra fills that hole.

One issue I’ve had with xscreensaver on OS X has been the difficulty/impossibility of having the text displaying hacks use fortune (or any program, for that matter) as the source of the text.  Mike mentioned this morning that all those hacks appear to be able to call out to a URL.  This morning I felt strangely motivated, so I whipped up a quick ruby script that is basically an HTTP based fortune server.  Since ruby ships with OS X, it’ll make it easier in case anyone else wants to get it running as well.  Once I got that working, the question was how to have this launch automatically on OS X so I wouldn’t have to worry about it.  I’ve played with Lingon on and off, and it seemed like the tool to help me do it.  I used Lingon to create a UserDeamon that should launch when one logs in, and should die when one logs out.  I then went through the screen savers that call out to text and pointed them at the localhost URL, and boom, I was back to fortune city.

To recreate this you’ll need this fortune_helper.rb script I whipped up, Lingon to create the launcher or this fortune.plist (put in /Library/LaunchDaemons) and fortune installed somewhere.  I installed fortune via DarwinPorts.

Gaming culture is getting out of hand

This mourning in Roselle I saw a gold Corvette with the license plate "PWNED U"  Something is wrong about this, I’m just not sure what.

Another argument in favor of Open Source

Not to make light of a sad situation…  But here’s our quote of the day.

"Open source means that your software can continue even after you’re arrested for murder!" — MARK

zsh word splitting

Awhile ago, after I showed him how I indexed my mail with mairix, MARK gave me a zsh function to wrap a call to mairix and then invoke mutt.  For some reason, when using the function, I was never able to pass multiple search terms to mairix and have it return results.  It always failed.

It turns out that this was a zshism that I wasn’t aware of, and Mark might not have been as well.  I finally took the time to get to the bottom of this and I found this FAQ which explains how word splitting differs in zsh.  (All OTHER shells do it wrong, of course.)  In any case, my multiple search terms were being passed to mairix as a single command line argument, so, of course nothing matched.  I edit the script to call mairix ${=*} instead of mairix $* and it works now.

MARK might not have run into this because he might have SH_WORD_SPLIT turned on.  I do not.

Anyway, here’s the function:

mairix_mail (){
  if (( ${#argv} == 0 )); then
    # nothing to do
    mairix --help
    return
  fi
  # search
  mairix ${=*}
  # see the results
  # assumes results are in ~/Maildir/search_results
  mutt -f=search_results
}
alias gm='mairix_mail';

Bunny Block Bid

Killer Bunny CardWelcome to my new section on Our Reading of Killer Bunnies rules. 

In a discussion between Melissa, Chris, Mark, and myself, we have deceided that in a Bunny Block Bid the Kaballa go to the auctioneer instead of the discard pile.  The rules are silent on this, but in the spirit of being as obnoxious as possible, we feel the money going to the player is the way to go.  So let it be written, so let it be done.