Configuring window size and location

Specifying geometry for individual users

Individual users can specify unique geometry settings for their client windows. These settings do not change the default geometry resources for other users on the system.

To change the geometry for an individual user, perform the following steps.

  1. Create a file called .Xdefaults-hostname in the user's home directory.

  2. Edit the .Xdefaults-hostname file and add the new geometry resource specifications, using the following format:

    client*geometry: [widthxheight][±xoff±yoff]

    When you are finished, save your changes and exit the resource file.

  3. If you created the .Xdefaults-hostname file as root, assign the appropriate user permissions to the file:

    chown username .Xdefaults-hostname
    chgrp username .Xdefaults-hostname

  4. Start a Graphical Environment session.

Step 1: Creating an .Xdefaults-hostname file

Individual users can assign their own values to geometry resource specifications. You can either change the value of a geometry resource already set in the resource file, or you can set an entirely new geometry resource. These user defaults always override system defaults, allowing different users running the same clients to specify personal geometry preferences.

Individual resource settings are placed in a file called .Xdefaults-hostname, where host is the name of the host, or machine, where the client is running.

You can add an .Xdefaults-hostname file to a user's home directory in one of two ways:

NOTE: Lines in the resource files in the app-defaults directory do not always specify the client, because each file applies to only one client. If you create an .Xdefaults-hostname file by copying the relevant lines from a file in the app-defaults directory, be sure to add the client's class name or binary name to the beginning of each line if it is not already there. Refer to the client's man page to determine its class name.

When the user invokes a client, the client checks to see if an .Xdefaults-hostname file exists in $HOME. If such a file does exist, the resource values specified in the user resource file take precedence over any values assigned to the same resource in the resource database.

See also:

Step 2: Setting the geometry resource

As with all resources, geometry resource specifications must use the correct format. The syntax of the geometry resource variable is:

client*geometry: [widthxheight][±xoff±yoff]

client refers to the client you want to affect. You can supply either the client's binary or class name. geometry is the resource variable you are setting. The width and height arguments represent the size of the client window (most client windows are measured in pixels; however, terminal emulators such as scoterm and xterm are measured in characters). xoff and yoff refer to the x and y coordinates of the client window.

Both xoff and yoff are measured in pixels from the edge of the screen. They must always be specified in pairs, and xoff must always be specified first. Both specifications can be either negative or positive numbers.

The xoff argument represents the distance of a window from the left or right edge of the screen. A window with a +0 (plus zero) x-offset is located on the left side of your screen. A window with a -0 (negative zero) x-offset is located on the right side of your screen.

The yoff argument represents the distance of a window from the top or bottom edge of the screen. A window with a +0 (plus zero) y-offset is located at the top of your screen. A window with a -0 (negative zero) y-offset is located at the bottom of your screen.

For example, to position a window in one of the four corners of the screen, use one of the following xoff and yoff combinations:

Because xoff and yoff are measured in pixels, which are small units, it is difficult to specify a location and know exactly where that location is on your screen. Because corner locations are always +0 or -0, it is much easier to specify an exact corner location than it is to specify a location somewhere in the middle of your screen.

The following is an example geometry specification:

   ScoTerm*geometry: 80x25+0+0
The size of this scoterm window is defined to be 80 characters wide by 25 characters high. It is located at the top, left corner of the screen.

You can specify both the size and location of a client window, or you can specify one or the other. For example, to change the size of a scoterm window only, specify:

ScoTerm*geometry: 70x20

The scoterm window size is defined to be 70 characters wide by 20 characters high. Either the scoterm client provides a default x and y coordinate position, or if the scoterm client does not have a default position defined, the window manager automatically positions the scoterm window.

Likewise, you can specify only the location of a client and rely on the client to provide default size specifications. For example, to define the scoterm window so it appears in the bottom, right edge of your screen, specify:

ScoTerm*geometry: -0-0

See also:

Step 3: Assigning correct ownership permissions

If you generated an .Xdefaults-hostname file for a user from the root account, whether by creating the file or by copying the file from files in /usr/lib/X11/app-defaults, you must assign the file the correct ownership permissions. Run the chown command to assign the correct owner and the chgrp command to assign the correct group to the .Xdefaults-hostname file:

chown username .Xdefaults-hostname
chgrp username .Xdefaults-hostname

If you created your own .Xdefaults-hostname file, you can ignore this step. Your ownership permissions are already correct.

Step 4: Starting a Graphical Environment session

To see your new geometry settings, start a Graphical Environment session, either through scologin or by running startx from the command line.

Run the desired clients. When a client is started, it reads the $HOME/.Xdefaults-hostname file for your personal resource specifications. The new geometry settings are noted and the client's windows are configured accordingly.

If you created your own .Xdefaults-hostname file during a session, and you want the new geometry values applied to clients that are currently running, you need to restart the clients.

Next topic: Specifying geometry from the command line
Previous topic: Step 3: Activating the new geometry settings

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003