XFree86 on Darwin and Mac OS X : Run X Windows
Previous: Getting Started
Next: Outstanding Issues with the X server

4. Run X Windows

You will want to add the X windows executables to your path. Your path is the list of directories to be searched when you type a command. You will also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The way to do this depends on the shell you are using. With tcsh or csh add the following two lines to a file in your home directory called .cshrc (create this file if you don't have one yet):

setenv MANPATH "${MANPATH}:/usr/X11R6/man:/usr/local/man" 
setenv PATH "${PATH}:/usr/X11R6/bin"
Now type ``source ~/.cshrc;rehash'' to get these changes to take effect. On future logins, this file will be executed automatically.

You are now ready to go. On Mac OS X, you have to do a few extra steps each time you want to run X windows. You can't run XFree86 with CoreGraphics running since they both want to control the screen. So for Mac OS X you first need to logout. Then for Mac OS X DP4, from the login window type ``console'' as the user name and push login. For Mac OS X Beta, type ``>console'' as the user name. This should shutdown CoreGraphics and bring you up with a text console. Login again.

Now from the text console you can start X Windows in either Darwin or Mac OS X by typing ``startx''. After a brief wait at least one terminal window should pop up for you. So far it probably isn't very impressive as you might not even have a window manager running to allow you to move windows around.

When you are ready to quit X windows type ``exit'' in the main terminal window or quit with the window manager if you have one running. Unfortunately the X server won't shutdown correctly and you will get an apparently frozen screen with only a spinning beachball cursor on it. Nothing you type shows up on the screen, but in fact your keystrokes are being received by the console. Type ``logout'' to return to normalcy after a brief delay. With Darwin this should put you back at the text console login prompt. With Mac OS X, CoreGraphics will restart and you should be given a login window.

Customize X Windows

X windows is very customizable and you will certainly want to change some things. There is a lot you can do to control how your windows look, how the windows are moved, resized, etc. You will likely want to get a better window manager than twm, which is included with XFree86. The .xinitrc file in your home directory controls what programs are run when you start X windows. You can find a sample .xinitrc file in /private/etc/X11/xinit/xinitrc.

There are several window managers that have been ported to Darwin. The best collection of window managers and other X windows applications is at Darwinfo's ports page. Another good place to look for Darwin ports in general is at Stepwise's Softrak site.

Good luck!


XFree86 on Darwin and Mac OS X : Run X Windows
Previous: Getting Started
Next: Outstanding Issues with the X server