When utilizing a desktop environment other than GNOME, or when using a non-default theme in GNOME-shell itself, you may often encounter incompatibilities which are mostly reflected through native GTK apps such as GIMP, Nautilus, Totem, etc…
One of these incompatibilities I’m talking about is the un-fitting style of GTK apps tooltips, which in some cases can be rendered simply unreadable (see image above as example).
However, as always with Linux and its open attitude towards its users, you can have a say on the matter, or, more accurately, you can in fact change it to your likings.
How to change the tooltip’s color
Before you do anything, it’s first a good idea to note that the styling of GTK apps nowadays is divided into 2 main categories:
Either a certain app is styled using GTK v2 – apps that still haven’t been completely ported to GTK 3 – such as GIMP for instance.
Or, the app is styled using GTK v3 – native GNOME 3 apps – such as Nautilus for instance.
Now, the reason I’m mentioning there’s a difference is because this means you may need to edit different files according to your specific situation, here’s how you do it –
GTK V2 apps
With GTK v2 apps, you should change a file called gtkrc-2.0. Often, there’s a global theme file found inside your home directory and it’s usually hidden.
So look for file answering to the following path (if it’s not present, you may also create it): ~/.gtkrc-2.0 (note the dot at the file beginning).
Open the file with your favorite text editor, insert the following and then save it:
style "gnome-color-chooser-tooltips"
{
bg[NORMAL] = "#FFFFAF"
fg[NORMAL] = "#000000"
}
widget "gtk-tooltip*" style "gnome-color-chooser-tooltips"
Restart any GTK app you’ve been using and the change should now take effect.
GTK V3 apps
With GTK v3 apps, you should change two files, one called gtk.css and one called settings.ini. These files are usually found inside your current theme directory, which is commonly located at
/usr/share/themes
Or
~/.themes
Look inside either of those directories for the name of the theme you currently use and go inside it, go inside gtkrc-3.0 folder, then open up gtk.css file with your favorite text editor and search for tooltip_bg_color (background color) / tooltip_fg_color (foreground color).
Change the 6 digits value found right next to those properties (straight after a # sign) like so:
tooltip_bg_color #FFFFAF;
tooltip_fg_color #000000;
Open up settings.ini file which should be in the same folder as gtk.css. Once again look for the tooltip properties and change the values right after the adjacent # sign ( composed of 6 letters / numbers) to match the ones used in gtk.css file (see image example).
Restart any GTK app you’ve been using and the change should now take effect.
Note regarding color values
In both cases above we make use of a hexadecimal number to represent colors. This 6 digits number can be broken into three building stones which comprise the end result color.
Each couple of digits is representing the three primers – red, green, blue – respectively.
The digits starts at 0 through 9 values, then continue with A through F as max values, so you can go ahead and adjust them to your likings.
For instance: #ff0000 will give you the reddest color you can get, and #0000ff will give you the bluest.
Alternatively, you may search for online automatic color generators if you like as well.
If you like this How To then you may also be interested in How To: Change Xfce Panel Text Color.