Changing cursor appearance

Specifying Desktop cursors for the entire system

To make a Desktop cursor change, perform the following steps. You must be logged into the system as root to perform this task.

  1. Create a customized picture directory and move the new bitmap file into this directory.

  2. Open the system Desktop resource file, /usr/lib/X11/app-defaults/XDesktop3, for editing.

  3. Make the desired cursor resource specification(s):

  4. If users are running the Desktop at the time you make cursor resource changes, they must restart the Desktop to see the new cursors.

Step 1: Creating a picture directory

The default Desktop cursors are located in the default picture directories, /usr/lib/X11/IXI/XDesktop/bitmaps/xdt_c_[large|small]. You can look in the files located in these directories to see sample bitmap files and filenames, but do not edit the files in this directory. If you want to edit a default Desktop cursor, copy the default bitmap file, then make desired changes to the copy.

In addition, instead of adding your new bitmap file(s) to one of these directories, it is recommended that you create your own picture directory and store the customized bitmaps in this new directory. The picture directory can be located anywhere, but make sure it is in a logical place so that subsequent bitmap files can be stored in this directory also. For example, it is probably logical to create a directory in a system path to store cursors that affect the Desktop system-wide. A recommended location would be in /usr/include/X11; for example, creating a directory called /usr/include/X11/Newbitmaps would probably be more logical than creating a directory in your $HOME directory path. Nevertheless, you can designate any directory to be the new bitmap directory.

Step 2: Editing the client resource file

The default resource file for the Desktop is /usr/lib/X11/app-defaults/XDesktop3. The resources in this file are read when the Desktop is invoked. If you want to specify Desktop resources that affect all users on your system, this is the file to edit.

NOTE: If you intend to modify the XDesktop3 file, it is recommended that you either make a backup copy of the file before you enter your resource changes, or comment out old resource values before entering new ones. This way, you are assured of regaining the default values, if needed. Note also that a risk of editing a system resource file is that changes can be overwritten if your system is reinstalled.

See also:

Step 3: Setting the cursor resources

There are two different resource specifications you might need to set: the cursor resource specification, which consists of the pair of resources and resource_name.mask, and the picture directory specification, which involves setting the pictureDirectory resource.

Cursor resource specifications must use the following format:

   !Class: XDesktop3.Cursor.Bitmap
   * bitmap_filename

!Mask !Name: !Class: XDesktop3.Cursor.Bitmap *resource_name.mask: bitmap_filename

The lines preceded by an exclamation mark ``!'' are comments. It is important to comment your new resources so that you or other users can understand the intent of the specifications.

* represents the resource name of the data pixmap. See ``Resources that control Desktop cursor appearance'' for a list of valid cursor names. The data pixmap defines the image associated with the cursor, for example, a hand or an hourglass. *resource_name.mask represents the resource name of the mask pixmap. The mask pixmap defines the shape, or the outline, upon which the data pixmap is drawn. The mask is needed so that the image shows up on any color of background.

bitmap_filename refers to the name and location of the new bitmap file. You can indicate where the new bitmap file is located by specifying the new bitmap location with an absolute pathname in both the .data and .mask cursor resources. For example, if your data and mask pixmap files are located in /usr/include/X11/Picture in files hand_d_xbm and hand_m_xbm, respectively, and you want these pixmaps to represent the idle cursor on the Desktop, specify their location by adding the following to the cursor resource:

* : /usr/include/X11/Pictures/handbit_d_xbm
*idle.mask : /usr/include/X11/Pictures/handbit_m_xbm

If you do not indicate an absolute pathname in the .data and .mask resources, you must specify the pictureDirectory resource.

The pictureDirectory resource contains the list of directories that are searched when a picture file with a relative name is specified. This list is searched sequentially, so the most frequently accessed directories should be placed at the beginning of the list.

If you do not specify an absolute pathname for the .data and .mask cursor resources, you must add the pathname of the new picture directory (the directory where your bitmap file is located) to the pictureDirectory resource in the XDesktop3 resource file. By default, the resource looks like this:

   !Name: xdt3.pictureDirectory
   !Class: XDesktop3.PictureDirectory
   !Default: No default value.
   *pictureDirectory: $XDTBITMAP/xdt_c_large \
   $HOME/.xdt_dir/bitmaps/xdt_large \
   $XDTBITMAPS/xdt_large \
The first directory indicated is the first path searched, when relative pathnames are specified in cursor resources.

Add the absolute pathname of the directory created in Step 1 to the beginning of this resource. For example, if you decide to store your bitmaps in a directory called /usr/include/X11/Pictures, make sure this directory is the first directory indicated. The resource line is similar to this:

   *pictureDirectory: /usr/include/X11/Pictures \
   $XDTBITMAP/xdt_c_large \
   $HOME/.xdt_dir/bitmaps/xdt_large \
   $XDTBITMAPS/xdt_large \

See also:

Step 4: Activating the new cursors

Once you have made the desired cursor changes to the Desktop resource file, the new specifications are immediately available to all users. However, if users were running the Desktop while you made your changes, they need to restart the Desktop before they see the new cursors.

Next topic: Specifying Desktop cursors for individual users
Previous topic: Changing the Desktop cursor

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