Customizing Fullscreen X11 on Mac OS X

There are a number of quirks you have to deal with when setting up a fullscreen X Windows environment for Mac OS X. I had to deal with a number of little quirks--all resolvable--setting up Mac OS X to mimic my Linux configuration.

In this document I'll assume you're using Apple's server in non-rootless mode. My full environment is different in that I have two instances of X11 running simultaneously. One is in fullscreen mode and the other is in rootless mode with QuartzWM. I describe how to set this up in my doc.

Using Fink

Use Fink CVS. It gives you about 1000 more packages than the standard Fink release. You can find instructions from Fink.

The .xinitrc and Window Managers

Every time you start X11, it starts the script .xinitrc in your home directory. When the script exits, your X11 session is over, and the program quits. If you don't have a .xinitrc, X11 uses a default one that starts the window manager quartz-wm (which gives each X window a Mac-style appearance).

You aren't limited to a particular window manager. I use an extremely light-weight one called EvilWM. My .xinitrc ends with the line $HOME/bin/evilwm. The script therefore starts EvilWM and waits for it to finish (which may be hours later). If you want to use the Quartz window manager, the last line of .xinitrc should be simply quartz-wm.

If you use any window manager other than quartz-wm, then you should insert quartz-wm --onnly-proxy & in .xinitrc on the line just before your window manager. This allows copying and pasting to work between Mac OS and X.

Xresources or Xdefaults

If you have a .Xresources file (you know it if you do), you will need to load it manually. Unlike X on most Linux distributions, Apple's doesn't automatically check for a .Xresources file. Add the following line (or substitute .Xdefaults for .Xresources if that's what yours is named) to your .xinitrc: xrdb -load $HOME/.Xresources.

Mouse Cursors and xsetroot

You'll notice that whenever your mouse pointer is over the root window (the background), the cursor will be a big ugly X. To keep your pointer from being the X-shaped cursor, you'll need to use the program xsetroot. To get a normal cursor, add the following line to your .xinitrc: xsetroot -cursor_name left_ptr. There are also some strange cursors you can use if you wish, including gobbler (a turkey), shuttle (a spaceship), spider, pirate, gumby, watch, star, sailboat, and heart. The cursor dot is pretty good, and there are a wide variety of arrows. The program xsetroot can also change your background color (use xsetroot -solid [color]).

Keyboard Layouts and Mouse Button Configuration

For a laptop, the Apple's one-mouse setup is perfect. On my Dell, I found it awkward to use the right mouse button under the trackpad and even more awkward to make a middle-click by hitting both the left and right buttons. On my Powerbook, I use modifier keys to get middle and right click. Holding down on the Option/Alt key while clicking generates a middle click and holding down on the Command/Apple key gives a right click. Since I also use modifier keys for my window manager, I had to make some compromises. I created a file named .xmodmap-modkeys with the following contents:

! Make the Alt/Option key be Alt_L instead of Mode_switch
keycode 66 = Alt_L

! Make Meta_L be a Mod4 and get rid of Mod2
clear mod2
clear mod4
add mod4 = Meta_L

! Make Alt_L be a Mod1
clear mod1
add mod1 = Alt_L

To make this active every time is started, you should add xmodmap $HOME/.xmodmap-modkeys to your .xinitrc.


Coming soon...