Untitled Document

X Environment

After typing in your login and password, XDM checks your home directory for a .xsession file. If you have a .xsession file, it is executed. If you do not have a .xsession file, then the file /usr/local/X11R5/lib/X11/xdm/.xsession is executed. In order to change the Window Manager that is started, or to modify the other programs that are started when you log in, you must have a .xsession file in your home directory.

The CS department supports one Window Manager: twm.

If you want to customize your X environment, you may copy the default startup files and modify them accordingly. Make sure you know what you are doing before modifying the default setup, because it is very easy to make a mistake that will prevent you from logging in. When in doubt, ask the tutor for assistance.

The Xresources file

The Xresources file is read by your .xsession file when you log in. There are several command line options that can be given when an X client is run (see the man page for xterm for example.) Each of these command line options can be specified in the Xresources file. If the command line option is not specified, then the specification in the Xresources file is used as a default.

The .xsession files support two Xresources files. The system keeps a Xresources file in /usr/local/X11R5/lib/X11/Xresources. You may have your own customized Xresources file in your home directory.

Warning: If you modify your .xsession file, make sure that you do not remove the line that loads the system Xresources; things will stop working if you do not load the system Xresources.

Using a .twmrc

Twm (Toms Window Manager) is a window manager for the X-Windows system. It provides titlebars, shaped windows, several forms of icon management, user-defined macro functions, click-to-type and pointer-driven keyboard focus, and user-specified key and pointer button bindings.

The system default .twmrc file may be found in /usr/local/X11R5/lib/X11/twm. To customize the action and feel of TWM, you must first copy the .twmrc file to your home directory. To do this, type the following: cp /usr/local/X11R5/lib/X11/twm/system.twmrc $HOME/.twmrc

Features

The features included in the standard .twmrc are described here.

Pop-up menus

To see the pop-up menus, press one of the mouse buttons while the mouse cursor is located in the root (grey background) window.

The first menu is reached by pressing the left mouse button, while the mouse cursor is in the root window. It is labeled Window Options. This menu contains things you can do, such as Refresh the screen, Focus on a window, Move or Destroy a Window, Show or Hide the Icon Manager Window(usually located in the upper right corner of your screen), Reread the .twmrc file (useful if you've made some changes and you want to see the results without logging out and back in), and Exit TWM, the Tom's Window Manager program.

The second pop-up menu, reached by pressing the center mouse button while the cursor is located in the root window, is the Hosts menu. With this menu you can open a window on a particular computer host, such as Sirius, Jove, Csqr, Odin, or the PSU library, if you have an account on that machine. You will be given a login prompt for typing in your account name and password.

The third menu, reached with the right mouse button, is the Applications menu, giving you the option of opening certain applications, such as a calculator, a man page reader, a mail reader (elm), etc. Not all of these work on every machine. Xman is one that you may want to take notice of. It opens a window in which you can look at man pages.

Control Menus

The set of menus described in the previous section pop-up when the mouse cursor is on the root window. There is another set of menus that pop-up when the mouse cursor is on a window and the control key is pressed while a mouse button is being pressed.

Pressing the left mouse button while the cursor is within a window and you are also pressing the control key gives you a menu of Main Options, such as redrawing a window, or sending a kill signal to destroy the window.

Using the middle mouse button with the control key gives you some options for controlling the window you are currently in, such as changing to reverse video, or enabling the visual bell (the window will flash instead of beep when you make an error).

If you press the right mouse button while pressing the control key, you will be given the option of changing the size of the font in the window you are currently in, making it smaller or larger.

Cut and Paste

If you have several windows open and want to copy some text from one window to the other you can use the cut and paste feature of X.

First select the text in one window using the first mouse button (left). Then go to the window you want to paste that text to and press the second mouse button (center). The text will appear in the window just as if you had typed it yourself.

Key Bindings

Below is a chart of what happens when the mouse keys are pressed. Different things happen depending on where the mouse is and what keys are pressed at the time.

Button1
root & menu Window Options
Button2
root & menu Hosts
Button3
root & menu Applications

Button1
shift & window & raise
Button2
shift & window & move
Button3
shift & window & lower

Button1
control & window & menu Main Options
Button2
control & window & menu VT Options
Button3
control & window & menu Fonts

Button1
titlebar & menu move
Button2
titlebar & menu raise
Button3
titlebar & menu lower

Button1
icon & iconify
Button2
icon & move

Tips

When the size of a window changes let the computer know what the new window size is by typing: eval `resize` or resize

Logout

To end a session (logout) move the mouse pointer down to the "LOGOUT" box and click in the box. This closes all windows, resets the screen, and brings the XDM login window back. In general it is a good idea to stop any commands you have running before logging out.

Error messages

The error messages are re-directed to the .xsession-errors file in your home directory. To view the errors, type: cat $HOME/.xsession-errors. Usually you can ignore this file unless you are having problems running an application.