Changing cursor appearance

Specifying Desktop cursors for individual users

Individual users can use their own unique set of cursors on the Desktop. These cursors do not change the default cursors that are available to other users on the system.

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

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

  2. Create a file called XDesktop3 in the user's home directory.

  3. Edit the XDesktop3 file and add the new resource specifications, using the following format:
       !Class: XDesktop3.Cursor.Bitmap
       XDesktop3* bitmap_filename

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

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

  4. If you created the XDesktop3 file as root, assign the appropriate user permissions to the file:

    chown username XDesktop3
    chgrp groupname XDesktop3

  5. Restart the Desktop.

Step 1: Creating a picture directory

The default Desktop cursors are located in the default picture directory, /usr/lib/X11/IXI/XDesktop/bitmaps/xdt_c_[large|small]. You can look in the files located in this directory to see the contents of sample bitmap files and sample 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 store customized bitmaps in $HOME/.xdt_dir/bitmaps.

Step 2: Creating an XDesktop3 file

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

Individual resource settings are placed in a file called XDesktop3 in the user's home directory. If this file does not already exist, you can create it in one of two ways:

NOTE: If you create an XDesktop3 file by copying the relevant lines from the XDesktop3 file in the app-defaults directory, be sure to add XDesktop3 (the Desktop's class name) or xdt3 (the Desktop's binary name) to the beginning of each line if it is not already there.

When the user invokes the Desktop, the X server checks to see if an XDesktop3 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 3: Setting the cursor resources

There are two different resource specifications you may 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
   XDesktop3* bitmap_filename

!Mask !Name: !Class: XDesktop3.Cursor.Bitmap XDesktop3*resource.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.

* refers to 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 refers to 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 $HOME/.xdt_dir/bitmaps/Pictures 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:

XDesktop3* $HOME/.xdt_dir/bitmaps/Pictures/handbit_d_xbm
XDesktop3*idle.mask: $HOME/.xdt_dir/bitmaps/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 beginning of the pictureDirectory resource in the $HOME/XDesktop3 file. The resource would now look similar to this:

   !Name: xdt3.pictureDirectory
   !Class: XDesktop3.PictureDirectory
   XDesktop3*pictureDirectory: $XDTBITMAP/xdt_c_large \
   $HOME/.xdt_dir/bitmaps/xdt_large \
   $XDTBITMAPS/xdt_large \

The first directory indicated is the first path searched, so the new Pictures directory is now searched first. The other directories in the resource are the directories searched sequentially by default when relative pathnames are specified.

See also:

Step 4: Assigning correct ownership permissions

If you generated an XDesktop3 file for a user from the root account, whether by creating the file or by copying the /usr/lib/X11/app-defaults/XDesktop3 file, 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 $HOME/XDesktop3 file.

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

Step 5: Restarting the Desktop

If you are not running a Graphical Environment session, you must start the Desktop before your new resource values can be recognized.

If you are running a Graphical Environment session, you must restart the Desktop before your new resource values can be recognized. Use the Restart Desktop Session option on the main Desktop File menu.

Next topic: Changing the scoterm cursor
Previous topic: Step 4: Activating the new cursors

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