CS551 - Self-Study Exercises

Exercise 1: X's "Standard Clients"

This exercise provides an introduction to some of the most basic X clients. It also introduces the standard command-line options, which are supported by most well-designed X applications.

You should have read Chapter 1 in Nye and O'Reilly, Vol. 4, before starting this exercise.

  1. Use the xman facility to learn more about xcalc. To do this, select "Manual Page" in xman's window. The xman window is an example of a "paned" application; you can alter the proportions of the two subwindows by grabbing the small black rectangle (called a grip) and moving it. Scroll through the directory subwindow until you locate the entry for xman, then select it to bring up the corresponding text. Read the "Description" section.

  2. Most X clients honor a few standard command-line options (the information can also be found in the man page on X, but note that since this is a captial letter, it appears at the very top of the xman directory, not with the X client entries). Use the information on "Color Specification", "Color Names", and "Window Geometry" in Appendix B of the text (Vol. 4) to modify the colors, size, and positioning of a client.

    What is the effect of including (a) just width/height information? (b) just x/y offsets?

  3. Many X clients also use specialized options to control their appearance or use. Through xman, you can find the syntax and meaning of these non-standard options.

    In your own words, describe a non-standard option for: (a) xcalc; (b) xclock.

  4. In your course directory, create a subdirectory labels. Copy all files from course/labels into your directory.
    NOTE: From here on course will be used to refer to the general course directory, ~cs551/files

    Run make, then invoke labels in the background, with no arguments.

    What does it do?

    How does that change when you invoke it with an integer value? When you invoke it with an "invalid" value (e.g., a negative integer or letter)? When you invoke it with one of the standard X command line options? When you invoke it with non-existent "X- like" option (e.g., -highlightColor)?

  5. Leave the application running. Note that an .Xdefaults file was supplied with labels, but it isn't taking effect because X doesn't realize it's there. You could move it to your home directory, where it would be found automatically. Instead, make the file known to X by setting the XENVIRONMENT variable:
    setenv XENVIRONMENT .Xdefaults

    Now invoke a second instance of the program, again in the background. What is different about the two?

  6. There are many times when you want to capture the appearance of an X application. There are a number of standard X clients to help in doing this. Try out the following: