Monday, June 19, 2006

X11 marks the spot

Over the past year, I've grown fond of my Linux box and sorely miss it when I'm using my PowerBook on the go. Luckily a couple of computer science professors introduced me to two invaluable tools. Now I can run my favorite programs without going through the hassle of installing a separate OS.

The first tool is Fink. This project ports Unix software to Darwin and Mac OS X. It also allows you to manage your packages with dpkg and apt-get, one of the most attractive and celebrated features of Debian. Download Fink from the SourceForge project site and install it. Installation instructions are available there. I ran into trouble because I already had a .profile and .Xresources file. I moved these files to another path and ran pathsetup.sh again. After that, everything went smoothly. Once you have Fink installed, you can use dselect and apt-get on the command line—which I'm sure makes you very happy if you're a Debian vet.

Now you'll want to install Apple's X11 or XDarwin. When you're running X11 within Mac OS X, it probably makes more sense to choose Apple's X11, even though it doesn't have quite the same features as XDarwin does. Supposedly it is available on the third Panther CD. (Since I only have the first two Panther CDs, I can't confirm this.) I downloaded it from the Apple web site. The installation was easy.

Before you start your X server for the first time, you should configure it to initialize Fink. You'll need a file named .xinitrc in your home directory for this. I copied an existing one and modified it to suit my needs.

$ cp /private/etc/X11/xinit/xinitrc ~/.xinitrc

Open the copy in your favorite editor.

$ sudo emacs .xinitrc

Now add the following line to the top of the file. This will tell the X server to initialize Fink before anything else. In my copy, I added three more lines at the end of the file to start the KDE window manager.* You can do other cool things, but I'll leave it at that for this example.

. /sw/bin/init.sh

export KDEWM=kwin
quartz-wm --only-proxy &
/sw/bin/startkde > /tmp/kde.log 2>&1

Once you've saved the file, you can begin using your X11 environment. To start Apple's X11, go to the Utilities folder (Command + Shift + U in Finder) and double-click X11. You need to change your preferences to run in full screen mode. Full screen mode is toggled with the Command + Option + A shortcut. Once the X server has initialized you have a UNIX-like environment for your computing pleasure.

* Note that you don't have to use KDE. I chose it because it seems to be the most fully supported window manager for Fink.

No comments: