Page 1 of 1

Blinking cursor (caret) color and width...

Posted: Fri Sep 04, 2020 11:27 pm
by invex
LM 20 Cinnamon

I found this article on how to change caret color and width.
Changing width works fine but I can't get the color working.
What's would be a proper syntax?

This is what's in my gtk.css

.nemo-desktop.nemo-canvas-item {
color: #FFC107;
text-shadow: 0px 0px @desktop_item_text_shadow;
* { -GtkWidget-cursor-aspect-ratio: 0.2; }

Re: Blinking cursor (caret) color and width...

Posted: Fri Sep 11, 2020 4:28 pm
by diapason
I see no-one has replied to you yet.

This is what works for me in the LM20 Cinnamon terminal:

Code: Select all

echo -e "\e]12;red\a"
Just change red to green, blue, magenta or whatever. It only holds for the session. It will revert when you close the terminal but that's how I use it. I'm sure it should be possible to make the changed colour default but I have never had the need to try.

As always, try my suggestion at your own risk and be sure to take a Timeshift before you start, just in case.

Re: Blinking cursor (caret) color and width...

Posted: Fri Sep 11, 2020 5:14 pm
by diapason
I had an unexpected bit of spare time so I had a look for you and it is all really quite simple.

Open your terminal. If the menu bar is not there, right click in the window and you will get a menu with an option to show the menu.

Then , click on EDIT and select Preferences and, in the left hand window, under Profiles, click the down arrow against UnNamed and change the name to whatever you like.

In the right hand window you have five self explanatory tabs where you can personalise everything. For your particular issue, click on the Colours tab and uncheck the box "use colours from system theme".

Check the Cursor Colour box and then click in the two boxes to select the cursor foreground and background colours. Click Close and you're done. To revert to the system theme colours just check the box again. You can also change your text colour etc. if you want to.

I only use the method I described earlier because I am quite happy with white text and a white cursor unless I am doing a long page of entries when I find it easier to keep track of the cursor if it's flashing red in among all the white text.

Re: Blinking cursor (caret) color and width...

Posted: Fri Sep 11, 2020 7:13 pm
by diapason
Sorry, I initially responded on the basis of the title of your post when browsing the forum from my cell phone and assumed you were asking about the terminal. I have just read the detail and I guess you are actually referring to the cursor which appears in desktop applications judging by your reference to your gtk.css.

That's not so easy and probably why you haven't had lots of replies.I know a few years ago there were people (including me) very keen to increase the width and/or change the colour of the cursor in LibreOffice Writer. The LibreOffice help pages did not offer any solutions for Linux and I don't think a solution was ever found in any of the various forums. The problem seemed to be that the cursor is controlled by the desktop theme and editing that is not straightforward.

There must be someone around on the forum who will know if it can be done. The "Other Topics" section perhaps doesn't get quite so much attention from regular forum browsers. If I were you, I would re-post the question in the Software and Applications section where it is bound to get more views.

Re: Blinking cursor (caret) color and width question...

Posted: Fri Sep 11, 2020 9:36 pm
by MrEen
Duplicate thread merged into this one with extraneous posts removed.

Re: Blinking cursor (caret) color and width question...

Posted: Sun Sep 13, 2020 11:16 am
by diapason
Hello again. I see your post is getting hits but still no responses so far. I've been playing with the issue in my spare moments. The following might help.

First of all, I had no luck with the syntax found in that link you posted. Also, if I look in my gtk.css I don’t see what you are seeing.

From what I have read, the caret colour seems to come from the desktop theme. I use the Mint-X theme so change Mint-X in the commands below to suit. I have chosen to use cursor colour red just for this example.

Before you try this, be sure to take a backup of your theme folder.

Open a text editor with sudo (I used sudo gedit). Browse to

Code: Select all

Change theme_fg_color from #212121 to #ff0000 save, exit and reboot. You will now have a red cursor in all your apps. The text entered will still be black but, unfortunately, all the window column headings etc. will now display in red matching the cursor. These red headings are also picked up by most programs installed from Software Manager but not all (eg Firefox is not affected). Some, but not all external source programs are also affected. In LibreOffice, strangely the cursor remains black. There must be another setting somewhere which controls that.

As far as I can tell, the only cursor that is not affected by the above is the Menu search bar cursor. To change that, in your text editor open

Code: Select all

Scroll down to line 177 (in Mint-X) and change the colour to #ff0000 to get a red cursor in Menu.

There may be some way to change only the cursor colour without affecting column headings etc. Perhaps someone out there will know.

Re: Blinking cursor (caret) color and width question...

Posted: Mon Sep 14, 2020 10:43 pm
by invex
Thank you *very* much.
I tried but it didn't work for me. Mint-Y-Brown doesn't have gtk-main.css so I edited gtk.css.

Re: Blinking cursor (caret) color and width question...

Posted: Mon Sep 14, 2020 10:56 pm
by diapason
Ah, sorry, I had forgotten that your original post referred to the gtk.css file which means you are using Mint-Y themes. I stick with Mint-X and so I tend to think everyone else is using X.

I think the same principle should apply though and you should be able to edit gtk.css to get what you want. It will just be a matter of finding the right element to change. Someone else who is using the Y themes might pick up on this for you. I am a bit busy for the next week or so but, when I get a spare moment thereafter I will load a Y theme and have a play out of curiosity. If I get a result and your post is still not marked solved I'll post another message.

Re: Blinking cursor (caret) color and width question...

Posted: Tue Sep 15, 2020 10:43 am
by invex
Great! :)

Re: Blinking cursor (caret) color and width question...

Posted: Thu Sep 17, 2020 2:56 pm
by diapason
Some mixed news. I have been able to change the caret colour in your Mint-Y-Brown theme for the text entry fields in many places but it has so far been impossible to change the caret colour in LibreOffice or Firefox.

First what works.

Code: Select all

Scroll down to line 131 and change currentColor to whatever colour you want to use (I tested with #ff0000 which is red). This will give you a colour change to the caret in the text entry boxes for some but not all apps in the menu. There is another caret-color at line 2662 but I couldn't see which caret that has an effect on.

Code: Select all

Scroll down to line 1044 and change the caret color to what you want. The result will be a change to the caret colour in the search box of the menu. There are two other carets at lines 72 and 837 but I couldn't see what carets they affect.

Code: Select all

There are five lines with caret entries (727, 736, 737, 1119, and 1690) but I couldn't identify where these carets function.

I'm sure there must be a global setting but I have had no luck finding it. I have played with that bit of syntax you mentioned in your original post and, modified it in various ways, but couldn't make it do anything except change the background in Firefox.

I had a look round on the LibrOffice website and one of the forums. People have been asking about changing the caret colour but there doesn't seem to have been a solution which works. What seems clear is that LibreOffice gets it's caret colour from the operating system. No-one seems to know where in the OS it picks it up. A LibreOffice person did offer a bit of code but I tried it and it didn't work.

It's extraordinary that something so clearly desirable is proving so difficult to achieve. The lack of response to your post rather underlines that. I'll keep looking at it on and off because it would be good to have an answer. I might want a bigger brighter coloured caret myself one day.

Re: Blinking cursor (caret) color and width question...

Posted: Fri Sep 18, 2020 12:25 pm
by invex
It worked!
Thank you *very* much.

>It's extraordinary that something so clearly desirable is proving so difficult to achieve.
I've been using Mint for over 4 years. The adjustable caret width and color plus Snap-to mouse option (very handy especially when using a touchpad) are the only things I miss in Mint.

Re: Blinking cursor (caret) color and width question...

Posted: Fri Sep 18, 2020 6:35 pm
by diapason
My pleasure. It was fun and a partial result is better than nothing.

I'm not giving up on the LibreOffice and Firefox carets, though. There must be an answer somewhere ..........