How do I change selection rectangle color?

Guys, I'll ask the same question I asked on another server and another channel, I just hope to finally figure this one out.

Dear MATE devs (if there's any of them on this forum, if there's none - I'm deeply sorry), I need a little help. I literally need to change one thing in my theme and I don't know how to do that. How do I change selection rectangle color?

All the forums and chats are dead and there's no documentation so I have nowhere else to ask.

3 Likes

Hi, @Seacat17 and welcome to the Ubuntu MATE Community!

maybe you can achieve this by changing the preferences of your terminal.

My terminal is white with black background, when I highlight text it becomes black on white background. Your terminal has preferences you can modify the profile; there is a section to define the highlight color.

Hope this helps.

3 Likes

If you are not sure how to get to what Pavlos was talking about. My terminal is green lettering on black background.

Edit> Profile Preferences> Colors

3 Likes

Do you mean like the rectangular outline that is displayed when you click and drag the mouse for the mate-screenshot tool for selecting an area?

Or do you mean (as explained by Pavlos and Jim) the highlighted text when you try to select text for copy+paste?

2 Likes

I mean the rectangle that appears when you click LMB on an empty space on your desktop and then drag your mouse while holding LMB.

Is this what you are referring too? (Seacat17 and ericmarceau )
I have never heard of LMB before this post.

3 Likes

LMB means "left mouse button" doesn't it? At least, it does in games.

2 Likes

Guys, come on... Yes, it's left mouse button.

Please read my post.

If it helps at all; this is usually called 'rubber banding'. It's probably something buried quite deep in GTK. Way beyond my experience.

1 Like

You should describe better your ask. It's not about selection from mouse. And after you use LFM word which is unknown by many of us.

Do you want to change color of the rectangle selection from click mouse? For my knowledge, why do you want change it?

On Ubuntu MATE, the color of the selection rectangle (rubber band) is controlled by the GTK theme. To change it, you need to modify the theme’s CSS file.

Method 1: Modify the GTK Theme CSS File

  1. Find the active GTK theme
    Open a terminal and run:

gsettings get org.mate.interface gtk-theme

Note the name of the current theme (e.g., Ambiant-MATE).

  1. Locate and edit the theme’s CSS file

Themes are usually stored in /usr/share/themes/ or ~/.themes/.

Open the CSS file:

sudo nano /usr/share/themes/YOUR_THEME/gtk-3.0/gtk.css

Add or modify the following section:

  • {
    caret-color: red;
    selection-background-color: rgba(0, 128, 255, 0.3);
    selection-border-color: rgba(0, 128, 255, 0.7);
    }
  1. Save and apply the changes

Press Ctrl + X, then Y, and Enter to save.

Restart the session or apply the changes with:

mate-panel --replace &

Method 2: Change the GTK Theme

If modifying the CSS doesn’t work well, you can switch to another GTK theme using MATE Tweak:

  1. Open MATE Tweak.

  2. Go to the Appearance > Theme section.

  3. Select a theme with a better selection color.

You can also install additional MATE themes with:

sudo apt install mate-themes

Let me know if you need more details!

10 Likes

THIS IS WHAT I NEEDED! Thankyou-thankyou-thankyou!

And answering your question... Most of the time I work with my computer at night. And I use the custom dark theme but for some stupid reason it's selection rectangle is bright as hell. I wanted to change that, so I won't burn my eyes at night.

1 Like

I've worked with computers, professionally and otherwise, for over 35 years, and ... never ... heard reference to LMB, or its use the way described in the article reference provided by Jim.

No, I have not been a participant in the "games world", so that may explain my "ignorance", but not a reason to use a turn of phrase that was suggestive of belittling! We were, after all, trying to root out the meaning of your original question.

4 Likes

In you first post you never even mention the mouse.

I mean the rectangle that appears

I read it, you talk about a square and USING the mouse, not about the mouse itself. It is NOT self explanatory, which is why you probably didn't get help anywhere else. The best way to get help is to be detailed and precise.

2 Likes