How to change a font/background color in transparent windows

colorsterminal

When you select something, the color of the selection usually changes to the font color, and the font color is being set to backgroud color. So, if you have a black background in a terminal, and the font is orange, you will get an orange selection and a black font color.

What would happen if you had a transparent window, and the transparency was set to 100%? Just take a look at the following pics.

The one with a black background:

pic

And the transparent one:

pic

Is there a way to change the font/background color of transparent windows?

Best Answer

I found a solution. There are two parameters that can be used (added to the ~/.Xresources file):

URxvt*highlightColor:       #000000
URxvt*highlightTextColor:   #D75F00

Here's the explanation:

   highlightColor: colour
       If set, use the specified colour as the background for highlighted
       characters. If unset, use reverse video.

   highlightTextColor: colour
       If set and highlightColor is set, use the specified colour as the
       foreground for highlighted characters.

And now the selected text on fully transparent window looks like this:

photo

Related Question