https://wiki.archlinux.org/api.php?action=feedcontributions&user=Levifig&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:36:33ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Cursor_themes&diff=574154Cursor themes2019-05-27T21:09:06Z<p>Levifig: The correct option for xrdb is -merge not --merge</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Eye candy]]<br />
[[es:Cursor themes]]<br />
[[it:Cursor themes]]<br />
[[ja:カーソルテーマ]]<br />
[[pt:Cursor themes]]<br />
[[ru:Cursor themes]]<br />
[[zh-hans:Cursor themes]]<br />
The display server is accompanied by a ''cursor theme'' that helps various aspects of GUI navigation and manipulation. The display server includes a cursor theme, however, other cursor themes can be installed and selected.<br />
<br />
== Installation ==<br />
<br />
Installation can be done with a package, or downloaded and extracted to an appropriate directory.<br />
<br />
=== Packages ===<br />
<br />
Cursors themes are available in the:<br />
<br />
* [[Official repositories]] — [https://www.archlinux.org/packages/?sort=&q=xcursor-&maintainer=&last_update=&flagged=&limit=50 "xcursor-" search].<br />
* [[AUR]] — [https://aur.archlinux.org/packages.php?O=0&L=0&C=17&K=cursor&SeB=nd&SB=n&SO=a&PP=50&do_Search=Go "cursor" search].<br />
<br />
=== Manually ===<br />
<br />
If a cursor theme is not available in the official repositories or the AUR, it can be added manually. A number of websites exist where cursor themes can be downloaded. Once downloaded, they need to be put in the ''icons'' directory (as cursors have the ability to be bundled with icon themes).<br />
<br />
Some websites that have cursor themes:<br />
<br />
* [https://www.gnome-look.org/browse/cat/107/ord/latest/ GNOME Look]<br />
* [http://www.customize.org/list/xcursors Customize.org]<br />
* [https://www.deviantart.com/browse/all/customization/skins/linuxutil/x11cursors/ Deviant Art]<br />
* [https://www.opendesktop.org/browse/cat/107/ Open Desktop]<br />
<br />
For ''user-specific'' installation, use the {{ic|~/.icons/}} directory. Extract them with this command that will work for most archives:<br />
<br />
$ tar xvf foobar-cursor-theme.tar.gz -C ~/.icons<br />
<br />
The cursor theme directory structure is {{ic|theme-name/cursors}}, for example: {{ic|~/.icons/''theme''/cursors/}}; make sure the extracted files follow this structure.<br />
<br />
{{Note|For ''system-wide'' installation the {{ic|/usr/share/icons}} directory is used. Direct extraction to this directory is usually discouraged as files here are not tracked by [[pacman]]; it is recommended to create a [[PKGBUILD|package]] for the cursor theme instead.}}<br />
<br />
Already installed cursor themes can be viewed with the command:<br />
<br />
find /usr/share/icons ~/.icons -type d -name "cursors"<br />
<br />
If the package includes an {{ic|index.theme}} file, check if there is an "Inherits" line inside. If yes, check whether the inherited theme also exists on the system (rename if needed).<br />
<br />
== Configuration ==<br />
<br />
There are various ways to set the cursor theme.<br />
<br />
=== XDG specification ===<br />
<br />
This method applies to both [[X11]] and [[Wayland]] cursor themes. <br />
<br />
For ''user-specific'' configuration, create or edit {{ic|~/.icons/default/index.theme}}; for ''system-wide'' configuration, one can edit {{ic|/usr/share/icons/default/index.theme}}.<br />
<br />
The {{ic|Inherits}} option in the {{ic|[icon theme]}} section must be set to the xcursor theme directory name {{ic|''cursor_theme_name''}}, for example {{ic|xcursor-breeze-snow}}:<br />
<br />
{{hc|~/.icons/default/index.theme|2=<br />
[icon theme] <br />
Inherits=''cursor_theme_name''}}<br />
<br />
You should then edit {{ic|~/.config/gtk-3.0/settings.ini}}, replacing the {{ic|''cursor_theme_name''}} with the chosen one: <br />
<br />
{{hc|~/.config/gtk-3.0/settings.ini|2=<br />
[Settings]<br />
gtk-cursor-theme-name=''cursor_theme_name''}}<br />
<br />
Re-login for the changes to take effect.<br />
<br />
=== LXAppearance ===<br />
<br />
[[LXDE#Cursors|LXAppearance]] sets the default cursor by creating an {{ic|~/.icons/default/index.theme}} file: if you edited that file manually, LXAppearance will overwrite it. Remember to also edit {{ic|~/.config/gtk-3.0/settings.ini}} manually as specified in [[#XDG specification]], because applications like Firefox use this setting instead.<br />
<br />
=== Desktop environments ===<br />
<br />
[[Desktop environments]] use the [http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html XSETTINGS protocol], typically implemented through a settings daemon. While this allows to change the cursor on-the-fly, the applied theme may be inconsistent across applications. See [[#XDG specification]] to change the cursor theme manually.<br />
<br />
==== GNOME ====<br />
<br />
To change the theme in [[GNOME]], use {{Pkg|gnome-tweaks}} or set the configuration directly with:<br />
<br />
gsettings set org.gnome.desktop.interface cursor-theme ''cursor_theme_name''<br />
<br />
Change the cursor size with (depending on the theme, sizes are 24, 32, 48, 64):<br />
<br />
gsettings set org.gnome.desktop.interface cursor-size ''cursor_theme_size''<br />
<br />
==== MATE ====<br />
<br />
In MATE one can use mate-control-center or gsettings. To change the theme:<br />
<br />
gsettings set org.mate.peripherals-mouse cursor-theme ''cursor_theme_name''<br />
<br />
To change the size:<br />
<br />
gsettings set org.mate.peripherals-mouse ''theme-size''<br />
<br />
==== XFCE ====<br />
<br />
To change the xcursor theme, use:<br />
<br />
xfconf-query --channel xsettings --property /Gtk/CursorThemeName --set ''cursor_theme_name''<br />
<br />
To change the size:<br />
<br />
xfconf-query --channel xsettings --property /Gtk/CursorThemeSize --set ''cursor_theme_size''<br />
<br />
=== X resources ===<br />
<br />
To locally name a cursor theme, add to the {{ic|~/.Xresources}} file:<br />
<br />
Xcursor.theme: cursor-theme<br />
<br />
To have the cursor theme properly loaded it will need to be done so by the window manager; if it does not, it can be forced to load prior the window manager by putting the following command in {{ic|~/.xinitrc}} or [[.xprofile]] (depending on ones personal setup):<br />
<br />
$ xrdb ~/.Xresources<br />
<br />
Optionally, add this line to {{ic|~/.Xresources}} if your cursor theme supports multiple sizes:<br />
<br />
Xcursor.size: 16<br />
<br />
{{Tip|32, 48 or 64 may also be good size.}}<br />
<br />
If in doubt over supported cursor sizes, start X without this setting and let it choose the cursor size automatically. (Refer to your window manager documentation for details.)<br />
<br />
=== Environment variable ===<br />
<br />
You can use an [[environment variable]] to set a theme for a single application to try it out temporarily, for example:<br />
<br />
$ XCURSOR_THEME=SomeThemeName xclock<br />
<br />
XCURSOR_SIZE is optional if your cursor theme supports multiple sizes.<br />
<br />
=== Display managers ===<br />
<br />
Cursor theme can usually be set within a display manager, but keep in mind the cursor theme may not carry over to the user session. <br />
<br />
==== GDM ====<br />
<br />
See [[GDM#Changing the cursor theme]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Create links to missing cursors ===<br />
<br />
Applications may keep using the default cursors when a theme lacks some cursors. This can be corrected by adding links to the missing cursors. For example:<br />
<br />
$ cd ~/.icons/''theme''/cursors/<br />
$ ln -s right_ptr arrow<br />
$ ln -s cross crosshair<br />
$ ln -s right_ptr draft_large<br />
$ ln -s right_ptr draft_small<br />
$ ln -s cross plus<br />
$ ln -s left_ptr top_left_arrow<br />
$ ln -s cross tcross<br />
$ ln -s hand hand1<br />
$ ln -s hand hand2<br />
$ ln -s left_side left_tee<br />
$ ln -s left_ptr ul_angle<br />
$ ln -s left_ptr ur_angle<br />
$ ln -s left_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd<br />
<br />
If the above does not solve the problem, look in {{ic|/usr/share/icons/whiteglass/cursors}} for additional cursors your theme may be missing, and create links for these as well.<br />
<br />
{{Tip|You can also remove unwanted cursors. To for example remove the "watch" cursor:<br />
<br />
$ cd ~/.icons/''theme''/cursors/<br />
$ rm watch left_ptr_watch<br />
$ ln -s left_ptr watch<br />
$ ln -s left_ptr left_ptr_watch<br />
}}<br />
<br />
=== Supplying missing cursors ===<br />
<br />
Some programs set their own custom cursors {{ic|~/.Xresources}} which you may want to override. A common example of this is rdesktop, which connects to a Microsoft Windows computer and uses the cursors obtained from the remote machine, which can often be difficult to see due to protocol limitations yielding poor conversion quality.<br />
<br />
This can be resolved by replacing these cursors with ones from the same (or another) cursor theme. In order to do this, the '''hash''' of the image must be obtained. This is done by setting the {{ic|XCURSOR_DISCOVER}} environment variable prior to launching the application that sets these cursors:<br />
<br />
$ XCURSOR_DISCOVER=1 rdesktop ...<br />
<br />
The first time (and only the first time) the cursor is set, some details will be displayed, like this:<br />
<br />
Cursor image name: 24020000002800000528000084810000<br />
...<br />
Cursor image name: 7bf1cc07d310bf080118007e08fc30ff<br />
...<br />
Cursor hash 24020000002800000528000084810000 returns 0x0<br />
<br />
When Xcursor looks for missing cursors, the search path includes {{ic|~/.icons/default/cursors}} so this is where an image can be placed for Xcursor to find. First, create this directory if it does not already exist:<br />
<br />
$ mkdir -p ~/.icons/default/cursors<br />
<br />
Then link the hash to the target image. Here we are using the {{ic|left_ptr}} image from the {{ic|Vanilla-DMZ}} cursor theme:<br />
<br />
$ ln -s /usr/share/icons/Vanilla-DMZ/cursors/left_ptr ~/.icons/default/cursors/24020000002800000528000084810000<br />
<br />
The change will be visible as soon as the application is restarted. No special method of launching the application is required.<br />
<br />
==== rdesktop ====<br />
<br />
Here are some common Microsoft Windows cursors that rdesktop uses when connecting to a remote machine running Windows 7. Unfortunately, animated cursors are difficult to override as they are sent frame-by-frame, so one mapping will be needed for every frame!<br />
<br />
$ ln -s /usr/share/icons/$THEME/cursors/xterm ~/.icons/default/cursors/00000000017e000002fc000000000000<br />
$ ln -s /usr/share/icons/$THEME/cursors/right_ptr ~/.icons/default/cursors/00000093000010860000631100006609<br />
$ ln -s /usr/share/icons/$THEME/cursors/plus ~/.icons/default/cursors/01e00000201c00004038000080300000<br />
$ ln -s /usr/share/icons/$THEME/cursors/left_ptr ~/.icons/default/cursors/24020000002800000528000084810000<br />
$ ln -s /usr/share/icons/$THEME/cursors/left_ptr_watch ~/.icons/default/cursors/6ce0180090108e0005814700a0021400<br />
$ ln -s /usr/share/icons/$THEME/cursors/hand ~/.icons/default/cursors/d2201000a2c622004385440041308800<br />
$ ln -s /usr/share/icons/$THEME/cursors/watch ~/.icons/default/cursors/fc618c00da110f0034fd0e004e082400<br />
<br />
=== Change X shaped default cursor ===<br />
<br />
The default X shaped Xcursor appears in window managers that do not set the default cursor to left_ptr or in window managers using XCB (like [[awesome]]) instead of Xlib.<br />
<br />
To fix this simply add the following to your {{ic|~/.xinitrc}} , xsession or window managers startup configuration if possible (for example bspwm's bspwmrc). <br />
$ xsetroot -cursor_name left_ptr<br />
<br />
The list of cursor styles is in [https://tronche.com/gui/x/xlib/appendix/b/ appendix B] of the X protocol.<br />
<br />
=== .Xdefaults ===<br />
<br />
If you have conflicting cursors then it might be because a different cursor has been set in the {{ic|~/.Xdefaults}} file.<br />
<br />
<br />
=== Cursor size doesn't change on startup ===<br />
<br />
If you are trying to change cursor size via {{ic|~/.Xresources}} in your {{ic|~/.xinitrc}} and it doesn't work, make sure that xrandr runs before loading {{ic|~/.Xresources}}.<br />
<br />
Make sure your {{ic|~/.xinitrc}} looks similar to the following<br />
<br />
{{hc|~/.xinitrc|2=<br />
xrandr &&<br />
...<br />
xrdb -merge ~/.Xresources &&<br />
exec wm}}<br />
<br />
== See also ==<br />
<br />
* {{man|3|Xcursor}} — For more information about cursors in X (supported directories, formats, compatibility, etc.).</div>Levifig