Xcursorgen

From ArchWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Xcursorgen is a tool that allows for creation of cursor files to be used with Xorg. Cursor can be created from png files.

Installation

Install the xorg-xcursorgen package.

Usage

By default, the user has to supply two files to xcursorgen:

  • a square image file saved as png
  • a configuration

Xcursorgen takes two arguments: the configuration file and an output path.

The configuration file must at least contain the following, space-delimited values:

  • image size in pixels
  • hotx: the x coordinate of the pointer's tip
  • hoty: the y coordinate of the pointer's tip
  • file name

Suppose there is an image file named red.png of 32x32 pixels. Save this configuration file alongside:

red.cursor
32 2 4 red.png

and run

$ xcursorgen red.cursor default

This will create the cursor as default which can later on be used with xorg. The pointer's tip is located in the upper left.

Animated cursors

Animated cursors are created from multiple image files. For animated cursors copy the configuration line for each image file and specify a delay in milliseconds for each frame:

anim.cursor
32 2 4 anim01.png 50
32 2 4 anim02.png 50
32 2 4 anim03.png 50
32 2 4 anim04.png 50

Installing created cursor files

If only some cursors of an already existing cursor theme should be changed, create a custom directory in ~/.icons/. Create this file inside the folder:

index.theme
[Icon Theme]
Name = <name>
Comment = <comment>
Example = default
Inherits = <the old cursor theme>

Note that the <name> has to be the same as the directory name.

Next, copy the cursor file created from xcursorgen into a subdirectory cursors, e. g.:

RedCursors/
|── cursors
|   |── default
|   └── xterm
└── index.theme

Now, configure your system to use this newly created cursor theme. Note that most applications have to be restarted to use the new cursor theme.

For more information, refer to Manual Cursor theme installation.

See also