User Customization of X11 on 10.5 and 10.6

The use of a $HOME/.xinitrc file to customize X11 has been deprecated as of OS 10.5.  Unfortunately, due to time constraints, we haven’t set down in the documentation what users should be doing.  I hope to set some ideas down here to clarify the situation.

The old way:

The presence of a $HOME/.xinitrc file replaces the system’s default X11 startup sequence.  A couple of consequences are:

  1. The user must make sure to run a window manager (unless one isn’t desired), e.g. just having
    xterm
    will generate an xterm with no window decorations, and any further X11 applications started from that xterm will be unmanaged. In this case the user probably wanted something like
    xterm &
    quartz-wm
  2. The user must make sure that $HOME/.xinitrc ends with a non-backgrounding command, or X11 will quit immediately. This would be the case in the prior example above if the user had
    xterm &
    quartz-wm &

The new way:

Instead of a single $HOME/.xinitrc file, under the current incarnation of Apple’s X11 (and any Xorg 7, really), one can do the following:

  1. Create the directory $HOME/.xinitrc.d
  2. For anything you want to run, create an executable shell script in that directory.  For example, to run Fink’s xpad application on startup, create a $HOME/.xinitrc.d/xpad.sh (the name is somewhat arbitrary, but see below) with contents
    #!/bin/sh
    /sw/bin/xpad
  3. and make it executable via

    chmod a+x $HOME/.xinitrc.d/xpad.sh

    Note that in this case you don’t have to set a window manager.

    The window manager can be changed in the same way.  There is only one subtlety:  the contents of  $HOME/.xinitrc.d are run in the order that the filenames appear in a listing, and generally one will want the window manager to be run last, so its script should be named appropriately. For example, you could have 0-xpad.sh and 99-evilwm.sh scripts to run the evilwm window manager and start xpad automatically.

  4. It’s easy to keep a list of scripts that start one item, and to set whether they get run or not by using
    chmod a+x <name of script>.sh

    or

    chmod a-x <name of script>.sh

    respectively.

Note: It’s slightly more complicated to set things up for GNOME or KDE, and I will discuss that issue in a subsequent entry.

3 responses to “User Customization of X11 on 10.5 and 10.6

  1. Just felt you ought to know that your web site shows up quite strange in opera, at least on
    my end. I opened it up in Internet explorer and it was alright.
    Just wanted to pass that along.

  2. Sorry, but I don’t have much control over how WordPress formats the page.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s