Make your Mouse Cursor Theme and Size Consistent - Even with Compiz and/or Emerald

It is pretty common knowledge, around the Linux world, that simply adjusting a few prescribed settings in the preferences/appearance/themes part of the menu, will not always cut it. Since coming to Linux, a while back, I have been plagued by mouse cursor issues; with the most persistent issue presenting as my cursor having a difficult time making up its mind – concerning what what to wear that session – you know, that annoying “hybrid-theme” cursor. For those, like me, who fancy the redglass cursor theme; but hate the incompleteness, and other issues with it; you may take a liking to the gtk-Breeze-Red cursor, a KDE crossover cursor theme for gtk+. I have only been using it a few days; but its a keeper. Since coming to Linux, though, I have pretty much always used the X-cursor theme redglass, set at “16” (small to medium).

Now for the problem: As many of us already know, regardless of the chosen cursor theme, what happens is that various user activities force us to put up with briefly changing cursor themes and sizes, with most every app engagement. Before this configuration fix, I had: 1) an oversized redglass on the desktop, 2) the size I wanted - on my MATE applications, 3) the default DMZ cursor theme in Firefox, and 4) a combination of all three versions in LibreOffice, and most other software applications.

After about eight months of digging, I realized that none of the advice, on the net, worked 100% for MATE. There were still going annoying issues with the cursor theme changing-up in the middle of every session - that annoying “hybrid theme.” The advice typically had you putting, or tweaking, configurations files in various “default” folders – in the “~/” directory, and/or, in the “/usr/share/icons” folder. I can vouch that none my versions of MATE 1.08-MATE through MATE-1.16 ever did have one of those “default” folders; thus you first had to create them – only to achieve little to no success. This cursor problem definitely has levels of severity, too; but if you carefully do what I have instructed, here, then all mouse cursor headaches should vanish. Anther thing that they have us MATEaholics doing is creating symbolic links all over the place; that’s a cool thing for many path oriented needs; but, unfortunately, my MATE, with Compiz + Emerald did not cooperate enough for any of this advice to workout - for those proposed cursor fixes. Anyway, I read a hundred tutorials; experimentally tweaked a couple of dozen different files; got on all the official document sites put out by gtk+; and, finally, honed-down a, perfect, personal recipe. I have given these steps out to be tested by me, and others at the office, throughout many sessions. We have yet to experience even one annoying mouse cursor issue since

Global Warning

It is important to, first, note that in order for this method to work properly, your actual theme folder must reside in “/usr/share/icons” and not merely just somewhere in “~/” - i.e., hidden icon and/or theme oriented folders and files of your home directory. My method puts you in charge of making your cursor theme (and the other gtk+ themes) persistent and global – whether other potential users wish to use your cursor theme, all the time, or not. So if you do not wish for a wholly global cursor theme, hanging out in your rig – stick with exclusively altering the hidden “.folders” and “.files of your “~/” directory. Unfortunately, if you are experiencing issues caused by Emerald, none of those “local only” methods really work – from my experience – and via what I have read over the course of the last year and a half; so, I can’t help you there.

Also, I will use the examples of size “16” and the cursor theme “redglass” for the totality of this tutorial – so just substitute your theme preferences for those values).

Step 1:

In MATE, you need to access gsettings via your dconfig Editor.

In dconfig, first go to:

org-gnome-desktop-interface

You will change/confirm the size and theme name there

Then in dconfig Editor, go to:

org-mate-desktop-peripherals-mouse

Again, you will change/confirm both the size and cursor theme name there.

Step 2:

Then, for good measure, locally, put a set of values in for the size and name of your cursor theme.

You plausibly do not have a special ~/ file (hidden in your home directory), yet, called “.Xresources” - and assuming that you don’t, please create that new “.Xresources” file, there, in your home folder, as root. (the easiest way is to do this is to access your home directory via “Open as administrator,” with “caja-extension-gksu”)

In that same text file please put:

Xcursor.theme: name-of-cursor-theme-goes-here

Then, on very next line, directly underneath, (if your cursor theme supports multiple sizes) put:

Xcursor.size: size-of-cursor-goes-here

The whole deal should then look like this (with your theme and size substituted):

Xcursor.theme: redglass
Xcursor.size: 16

By the way, step 2 will do a good job - all by itself - in MATE; for “local only” cursor theme configurations - so long as you are not running Emerald

Step 3:

While putting your theme in “/usr/share/icons” is one method, which is supposed to keep your theme more consistent, it is actually this next step which ensures that every aspect of your theme is set everywhere – and that means absolutely globally. Notably, when MATE is using Compiz + Emerald - GTK, will, at the very least, present various applications having an issue where the cursors briefly, but consistently, change to the unwanted default cursor; when the cursor hovers over window edges, drags, or re-sizes app windows. And depending on their configuration, many users experience a total “hybrid” cursor scenario – changing themes and sizes with every app engagement. This issue is not Compiz, Emerald, or MATE specific; but with the combination of all three running things – you will likely get this buggy effect, at least, sometimes.

We will now fix this age old problem – once-and-for-all; so long as you are good with your mouse cursor theme showing up globally – even in your lightdm greeter. (I am, pretty much, the only one who uses my rig; so this situation is ideal for me)

Step 3 will be handled in "etc/gtk-3.0/settings.ini"

Go to “etc/gtk-3.0” and open the “settings.in” file in root (remember the “Open as administrator,” method, withcaja-extension-gksu” - if you prefer to do it that way)

Now, in root, in the “settings.ini” file, carefully modify the values of the gtk-cursor-theme-name to what you want (there, your other gtk-theme values can, likewise, be modified, if you wish). Again, in all of my examples, here, I will be using "size “16” and “redglass” - and due to user preferences, yours will look a little different; but you can figure out where to switch-out these values by the example, below:

/etc/gtk-3.0/settings.ini

[Settings]
gtk-theme-name = Numix
gtk-cursor-theme-name = redglass
gtk-cursor-theme-size = 16
gtk-icon-theme-name = GNOME-Noble
gtk-fallback-icon-theme = gnome
gtk-enable-primary-paste = false

Your gtk+2 folder, if you have one, will likely have its values left blank, or commented out, or both. Even though I have the new ‘all gtk+3’ setup – complete with MATE 1.16, I went on ahead and still tweaked this one too; but I’m not sure there is any reason too. The crucial thing to do, though, is to reset your above, gtk3 vaules.

Maybe older MATE installs, i.e., the ones with gtk2 in it, will benefit from the below tweak – either way, I can’t see how it could hurt anything; so below is the gtk+2 configuration, if you want it: (note that in gtk+2, the values actually go between quotations; but only, in the gtk+2 file – not in the gtk+3 file)

/etc/gtk-2.0/gtkrc

gtk-theme-name = “Numix”
gtk-cursor-theme-name = “Breeze-Red”
gtk-cursor-theme-size = “16”
gtk-icon-theme-name = “GNOME-Noble”
gtk-fallback-icon-theme = “gnome”

Step 4:

In “/etc/sysconfig/windowmanager” go and carefully make sure that everything matches up there; if not, change any values (in root) which do not represent your desired values.

Step 5:

For Compize Users Only

In your CompizConfig Settings Manager, go to "General Options. There, it opens right up to show you the cursor theme values, as well as the cursor size values; they are probably blank – so fill them in.

Logout/login and that’s it!

2 Likes

Expanding upon this, it can be so much easier long-term to use a symbolic link, link your theme with ln to whatever you told the system to expect and that would allow you to do both rm and ln in a single command to replace the theme by remaking the link.

This is kind of what doing anything with update-alternatives does. If you need to do anything with a theme outside of its originating directory, you ln it to where you want (with sudo if necessary, or cp to non-elevated space, sudo rm the original content and sudo ln to elevated space) and you can tweak it until you’re content.

Alternatively, you can sudo mv and chmod it with permissions for yourself, then you can sudo ln the files to much the same effect.

1 Like

You solidify my point, very well; and thus, I really like things 100% perfect - whenever I can get it, anyway. My post discuses the methods orbiting your advice - and it’s true those methods are helpful to get it just about right; but I’ll stick with every thing, finally, perfect. :grin: Thanks for reading my post! :wink:

Really that was my point; You can keep everything you have it but using links, you can just change that one thing and be done with it.

There are two methods; Link to actual file, and link to a link. Each have their advantages;
Link to a file implies the file exists somewhere on your system exactly as it is named. To change something you just run two mv commands and you apply your changes that way.
Link to a link is better if you don’t want your files to be stuck at a specific location, so you make your link where you want your other links to work from and you can then use ln to change to whatever set of files you want, wherever they may be.

I would think if Ubuntu MATE were to request a change for MATE overall, it would be to make a link to a link and act sort of as an alternative update-alternatives for the mouse cursor. It would fix the one thing that sucks about modifying MATE-anything and that would be changing the cursor without needing to go through all this stupidly-tedious work for something so simple on Windows, or heck, even Cinnamon and K.

1 Like

Oh, most definitely, @tiox, in theory everything you say is spot on. It is merely that all of the update-alternatives, and symlink easy buttons have left me, and so many others, with only a 90% fix.

The erratic themes just kept rearing their ugly heads, just when you think they’re finally going to behave. But, principally, the last 10% of the stubbornness stems from Emerald - and I am positive about that. When I go back to pure GTK+ widow decorator, the issues are pretty much solved with your methods (which were the same ones I used for months).

I love MATE; I love Emerald decorator; and now, finally - I love my cursor. We are going to just have to be content agreeing to disagree on this one. But on a MATE rig with Marco and/or the more conservative WMs and decorators, your most sensible method gets it done just fine. :smile:

An important aspect to note - and as my original post goes over, this little tutorial represents those, like me, who could not find satisfaction with the regular update-alternatives, symbolic link, etc., methods. Run the MATE, with Emerald, cursor scenario on a search engine; you will see what I mean - the threads tend to be very long; ripe with hopes - then dashed hopes - then frustrations. A typical chunk of a lot of the threads will say something like: "thanks a million - worked like a charm… only to come right back and complain that it did again on XYZ app.

The really awesome aspect, here, is that we are dealing with Linux: where the absolute freedom exists to do the same thing - a dozen different ways. :blush:

1 Like

I actually decided to follow your guide (with the notable exception stemming from my apathy about the login screen matching) and I didn’t see in CCSM the option under General Options to change my cursor.

But something else; You know dconf-editor settings accept symlinks as options yeah? Even if you can’t path to it, you can make a link of a directory in the directory dconf-editor would pull from and it would work. This is the linking thing I was mentioning earlier. Knowing this, I did the following;

sudo ln -s /etc/alternatives/x-cursor-theme /usr/share/icons/x-cursor-theme

So whatever I set for x-cursor-theme through update-alternatives would apply to the remainder of the system, only leaving size to adjust.

There is a cursor theme location for MATE, too;
org.mate.peripherals-mouse cursor-theme
In dconf-editor MATE cursor theme is stored at org/mate/desktop/peripherals/mouse

I have to redact myself slightly, I was incorrect;

sudo mkdir /usr/share/icons/x-cursor-theme
sudo ln -s /etc/alternatives/x-cursor-theme /usr/share/icons/x-cursor-theme/index.theme

That would make the x-cursor-theme entry in dconf-editor work.

I’ve only seen this for 0.8. I mentioned earlier I didn’t see such an option, that is until I installed Compiz 0.8, and I see it’s there.