Consistent mouse cursors, the "Alternative" way

:ubuntu_mate: Introduction

There was a tutorial here (credited below) earlier talking of how to make mouse cursors consistent across all of your applications. There is justification for it to exist, but I don't believe it is the easiest method in the long-run, considering Gnome and MATE keep two separate mouse cursor settings. Using some of the information provided in that thread, I believe there is an easier way, with a little bit of setup.

:terminal: Terminal to the rescue

...By means of symbolic links. Used for a variety of reasons, symbolic links this time are being used to have the same cursor apply everywhere.

This method means every time one desires the change the cursor, they must do sudo update-alternatives --config x-cursor-theme. But after using Linux systems for some time, using the terminal, despite how user-unfriendly it is in comparison to a GUI app seems to be the best way of doing things in some circumstances.

:globe_with_meridians: It also means this will apply globally, for all users. However if one wants to change it they can, in select instances they will still see the "Default" cursor though.

Here's how to make the specification in update-alternatives apply everywhere;

:heavy_dollar_sign: In x-terminal-emulator:

sudo mkdir /usr/share/icons/x-cursor-theme
# ^ Assuming this is what you call the directory; Name it whatever you wish.
sudo ln -s /etc/alternatives/x-cursor-theme /usr/share/icons/x-cursor-theme/index.theme
# ^ Using the directory made, take the theme index from /etc/alternatives
#   and use it as the index for theme "x-cursor-theme"
gsettings set org.gnome.desktop.interface cursor-theme x-cursor-theme
gsettings set org.mate.peripherals-mouse cursor-theme x-cursor-theme
# ^ Use the new theme, named "x-cursor-theme"
gsettings set org.gnome.desktop.interface cursor-size 18
gsettings set org.mate.peripherals-mouse cursor-size 18
# ^ Set a consistent cursor size. The value specified will appear later below.
pluma ~/.Xresources
# ^ See below about this.

For this particular file, it is a special hidden file which can be made to tell X what cursor is to be used. Not entirely sure if it's necessary but I'm throwing it in anyway. In .Xresources have;

:spiral_notepad: In your preferred text editor, for ~/.Xresources:

Xcursor.theme: x-cursor-theme
Xcursor.size: 18

That should do it. If desired, also append this as follows;

:ubuntu_mate: Hey — author from the future here.

I am not certain when these file quit existing, but they had at one point or another. This is only in select instances where of an older version of Ubuntu MATE, during MATE's transition from pure GTK 2.0 to retrofitted GTK 3.0 you want your GTK 2.0 settings to match.

The modern equivalent should be settings.ini which is only in /etc/gtk-3.0.

:spiral_notepad: In your preferred text editor, for /etc/gtk-3.0/gtkrc

gtk-cursor-theme-name = x-cursor-theme
gtk-cursor-theme-size = 18

After, since it seems this file is exactly the same give or take a few lines compared to /etc/gtk-2.0/gtkrc, this can be done;

:heavy_dollar_sign: In x-terminal-emulator:

sudo rm -rf /etc/gtk-2.0/gtkrc
sudo ln -s /etc/gtk-3.0/settings.ini /etc/gtk-2.0/gtkrc

:spiral_notepad: Conclusion

Why do we even have to do this? I don't get it myself, since Cinnamon does just fine with cursors, as does KDE. Also, this is for a single user; Multi-user environments may have disagreements on which theme to use, so I'll have a play with trying to individualize these settings, but undoubtedly it will involve the use of symlinks and variable values.

:information_source: Information sources

1 Like

I just realized; This is pretty much the same exact thing as update-alternatives does for the default directory in /usr/share/icons except for some reason use of default as a cursor entry in CCSM 0.8 doesn't work. Strange that.

Gave it a fresh coat of paint. This advice still works! Especially if you use Compiz Reloaded in favour of the default Compiz installation which comes with your system.