Cursor themes

From ArchWiki
Revision as of 11:43, 10 May 2014 by Chazza (Talk | contribs) (Using X resources)

Jump to: navigation, search

There are many cursor themes available besides the default black pointer. This guide will instruct you on where to get them, installing them, and configuring them.

Getting mouse cursor themes

First, check which themes you already have installed:

ls /usr/share/icons/*

Search for directories with the cursors subdirectory.

find /usr/share/icons -type d -iname "*cursors*"

Also, check the official Arch repositories for cursor themes: search "xcursor-".

Note: The xcursor-themes package comes with the 'redglass' and 'whiteglass' themes in /usr/share/icons.

Some themes available through AUR.

Here are links to where else you may download cursor:

Installing mouse cursor themes

This manual installation method is only required if you are not using pacman to install themes like described above.

Extract the cursor theme package:

$ tar -zxvf foobar-cursor-theme-package-foo.tar.gz

or

$ tar -jxvf foobar-cursor-theme-package-foo.tar.bz2

Make a directory for the cursor theme:

Example: FooBar-AweSoMe-Cursors-v2.98beta

User-specific installation:

$ mkdir -p ~/.icons/foobar/cursors

System-wide installation:

# mkdir -p /usr/share/icons/foobar/cursors
Note: To simplify the name of the theme, the name being used is 'foobar' instead of 'FooBar-AweSoMe-Cursors-v2.98beta' when creating the dir(s) above.

Copy cursor files into the appropriate directory:

User-specific installation:

$ cp -a FooBar-AweSoMe-Cursors-v2.98beta/cursors/* ~/.icons/foobar/cursors/

System-wide installation:

# cp -a FooBar-AweSoMe-Cursors-v2.98beta/cursors/* /usr/share/icons/foobar/cursors/

If the package includes index.theme file check if there is an "Inherits" line inside. If yes, check whether the inherited theme also exists under this name in your system (rename if needed).

Copy index.theme file into the appropriate directory:

User-specific installation:

$ cp -a FooBar-AweSoMe-Cursors-v2.98beta/index.theme ~/.icons/foobar/index.theme

System-wide installation:

# cp -a FooBar-AweSoMe-Cursors-v2.98beta/index.theme /usr/share/icons/foobar/index.theme

If the package does not have index.theme or if it does not include an "Inherits" line, you do not have to copy this file.

Create links to missing cursors:

Applications may keep using the default cursors when a theme lacks some cursors. If you experience this, it can be corrected by adding links to the missing cursors. For example:

$ cd ~/.icons/foobar/cursors/
$ ln -s right_ptr arrow
$ ln -s cross crosshair
$ ln -s right_ptr draft_large
$ ln -s right_ptr draft_small
$ ln -s cross plus
$ ln -s left_ptr top_left_arrow
$ ln -s cross tcross
$ ln -s hand hand1
$ ln -s hand hand2
$ ln -s left_side left_tee
$ ln -s left_ptr ul_angle
$ ln -s left_ptr ur_angle
$ ln -s left_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd

If the above links do not resolve the problem, look in /usr/share/icons/whiteglass/cursors for additional cursors your theme may be missing, and create links for them as well.

Note on cursor themes not working with awesome window manager

Xcursor does not work correctly with awesome window manager. You may notice all of the themed cursors work except the default cursor.

For more information see this link http://awesome.naquadah.org/wiki/FAQ#How_to_change_the_cursor_theme.3F

Choosing and configuring cursor themes

If you use some desktop environment like Gnome, you can use its GUIs to choose cursor themes. Alternatively you can use lxappearance to manage and apply cursor themes.

Using the XDG Icon theme specification

Note:
  • This will set both the X11 and Wayland cursor theme.
  • Even if you are using a tool such as lxappearance or dconf-editor to set the cursor theme, it is recommended that you create an index.theme file as well otherwise cursor themes will not be consistent systemwide and across all applications.

Using an index.theme file (recommended)

Create the following file (you may also need to create the directory):

/usr/share/icons/default/index.theme
[icon theme] 
Inherits=my-cursor-theme

where my-cursor-theme is the name of the cursor theme you wish to use e.g. Adwaita.

Tip: If your cursor theme is installed in ~/.icons you can create the index.theme file in the ~/.icons/default/ directory instead.

Using a symlink

Create a symlink named "default" in ~/.icons, which points to your installed cursor theme:

$ ln -s /usr/share/icons/my-cursor-theme/ ~/.icons/default

where my-cursor-theme is the name of the cursor theme you wish to use.

Note: This method will not set the cursor theme used in display managers and it may not set the cursor theme consistently across all applications. It is highly recommended that users create an index.theme instead, as described in the subsection above.

GNOME 3.8 and above

To change the cursor theme with GNOME 3.8 and above, run the following command:

gsettings set org.gnome.desktop.interface cursor-theme my-cursor-theme

With my-cursor-theme being the name of the cursor theme you wish to use.

Use the dconf-editor if you do not wish to issue a command.

Tip: For cursor theme consistency across all applications, you may need to create an index.theme file as describe above.

GDM

GDM disregards GNOME cursor theme settings and it also ignores the cursor theme set according to the XDG Icon theme specification - see above. To change the cursor theme used in GDM, you must create the following file:

/etc/dconf/db/gdm.d/10-cursor-settings
[org/gnome/desktop/interface]
cursor-theme='my-cursor-theme'

With my-cursor-theme being the name of the cursor theme you wish to use.

Then run the following command as root:

# dconf update

Using X resources

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

Xcursor.theme: my-cursor-theme

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.

See also

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