Revision as of 08:28, 22 September 2012

zh-CN:X11 Cursors
There are many cursor themes available for the X11 Windowing System besides the default black pointer.
This guide will instruct you on where to get them, installing them, and configuring them.

Choosing and Configuring Cursor Themes

If you use some desktop environment like Gnome, you can use its GUIs to choose cursor themes.

Using the XDG Icon Theme Specification

Note: This method will also set the Wayland cursor theme.

You can create a symlink "default" in ~/.icons, which points to your installed cursor theme:

$ ln -s /usr/share/icons/foobar/ ~/.icons/default

If you rather want to change the cursor globally (e.g. used by graphical login managers like kdm, gdm, ...), or if you experience problems with above method (for example in Firefox), create the /usr/share/icons/default/ directory (only if needed):

# mkdir -p /usr/share/icons/default (only if needed)

Edit or create the /usr/share/icons/default/index.theme file and add the following:

[icon theme]
Inherits=foobar

Or if you have/want your cursor themes in ~/.icons only. Create the ~/.icons/default/ directory:

$ mkdir -p ~/.icons/default

And create the ~/.icons/default/index.theme file with the same contents as above /usr/share/icons/default/index.theme.

Using X resources

To locally name a cursor theme, add to your ~/.Xresources:

Xcursor.theme: foobar

To have the cursor theme properly loaded it will need to be called by your window manager. If it does not, you can force it to load prior your window manager by putting the following command in ~/.xinitrc or .xprofile (depending on your setup):

xrdb ~/.Xresources &

You can optionally add this line to ~/.Xresources if your cursor theme supports multiple sizes:

Xcursor.size: 16 ! 32, 48 or 64 may also be good values

If you do not know about supported cursor sizes just start X without this setting and let it choose the cursor size automatically.

Refer to your window manager documentation for details.

More information

For more information about cursors in X (supported directories, formats, compatibility, etc.) refer to the man page:

$ man Xcursor

Note: If the animations are flickering on your nvidia card, add the following line to your /etc/X11/xorg.conf file, into the nvidia device section, to fix it: