Fortune is one of those old, useless programs whose novelty never quite wore off for me, despite the troubling lack of a switch to disable Star Trek quotes. A fortune on boot is, to me, still an essential feature of any OS.
In the Classic days, there used to be a Mac system extension that would do this, displaying a fortune in a dialog just before the Finder loaded. It's possible to duplicate this functionality on Mac OS X with a bit of AppleScript fiddling or third-party apps -- but who needs another login item slowing things down? A better, cleaner solution -- the one thats seems "right" -- is to use the "hidden" LoginwindowText default documented in an earlier hint to display a fortune in the login window. (robg adds: As seen in my screenshot at right; click it for the full version.)
Assuming fortune is installed via Fink (sudo apt-get install fortune-mod with Fink up and running), copy the following into a text file and save it as loginfortune.sh (or something similar) and make it executable with chmod +x loginfortune.sh:
#!/bin/sh
# NOTE: The following is one line; the backslash should let it copy
# and paste. If not, just replace the line break with a space.
/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow \
LoginwindowText -string "$(/sw/bin/fortune)"
Running this script will put a random fortune in your login window. To get it to change at each startup, read the rest of the hint...
To change the fortune at every login, create a folder called Hooks (or whatever you prefer) in the top-level Library folder, and then move loginfortune.sh into it. Next, run this command (again, make it all one line with just a space; replace the relevant bits with the right names on your system):
/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow
LoginHook /Library/Hooks/loginfortune.sh
This will now change the fortune each time you see the login window. Personally, the above is what I prefer because, should my computer crash, I am not further enraged by having to read the same fortune again on reboot. However, If you would rather change it on logout, use the LogoutHook default instead of LoginHook.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20041116043212702