X11 Configuration

colored bar

Introduction to X11

The X window system, formally know as X11 Release 6 or X11R6 for short, is a powerful, portable window frontend to computers. One of the reasons that it is so powerful and portable is that you can configure just about everything about it. Unforetunately, there is no pop-up window that lets you click your way to personal set-up bliss, the manual pages on X11 are obscure and the six volume set of documentation is daunting. X uses a customizable control file called .Xdefaults that resides in your home directory. You will want to edit this to use your favorite fonts and colors. To control which programs are run at login, you will want to create a file called .my_xinitrc that specifies what should be run when your session is initialized. I recommend that you find someone who has a working one and use theirs as a template. The most commonly twiddled settings are given below. More customization (such as remapping the keyboard) is possible; it just takes more work.

Setting the Display

You need to tell X where to display your windows. This is done by setting the DISPLAY environment variable Depending on your shell you type setenv DISPLAY "computer.address:0" (for the c shell, csh, or tc shell, tcsh), or you type export DISPLAY=computer.address:0 (for the bash shell). Where computer.address is the address of the computer you are using. The :0 on the end of the computer address tells X to use the primary (and almost always only) monitor associated with that computer.

Setting Display Permissions

The X window system has a permission system that controls who has the ability to display a window on your screen. If anyone can display images on your screen, you will get things like the emacs sessions of people who forgot to set their DISPLAY environment variables appearing on your screen. Or someone might pop a lewd photograph up during a debugging session with your advisor. To stop this sort thing, the permissions on physics are quite strict. By default only arthur, xphys1 and physics can display windows on eachother's consoles. To add another host to this list type xhost +computer.name where computer.name is the name of the computer you wish to include. To remove a host's permissions type xhost -computer.name. Be careful, you can remove permission for your own windows if you delete the your host from its xhosts list!

Setting the Fonts

There is a nice tool called xfontsel that helps with selecting fonts.

xfontsel window

I recommend using fixed width fonts because emacs has trouble keeping track of variable spaced fonts. Choose the characterisitcs that you want your font to have and then copy them into your .Xdefaults file as the value for the Xterm*font variable.

Setting the Colors

You can set several different backgrounds and foregrounds (emacs, xterms, defaults). You could make xterms on different computers use different colors. I recommend using the xco color selector although xcolorsel is also nice. Choose the foreground (font) and background (window) colors that you like and enter them into the .Xdefaults file as the values for the Xterm*foreground and Xterm*background variables, respectively.

Reloading the .Xdefaults File

To reload your .Xdefaults file after you have modified it type xrdb -load ~/.Xdefaults.

colored bar

Last modified 9/14/95
College of William and Mary, Dept. of Physics

matt@physics.wm.edu