How do I change the color of desktop icon text

20,144

Solution 1

After searching here and there to change the themes file, it seems I don't need to change anything in the theme to have this. In fact, It's not even possible without much hacking. Because Gnome Developers (for some reason only known to them) bundled most of the theme files in gresource binary file. The files in /usr/share/themes/Adwaita only for GTK-2 components. Gtk-3 files are in libgtk-3.so file and gnome-shell-theme.gresource file.

But finally I observed that the overridden file take effects actually, though it takes time.

You would override the theme. The content is same as given by Sillyman. The difference is, you write in gtk.css file in ~/.config/gtk-3.0 folder.

.nautilus-desktop.nautilus-canvas-item {
    color: blue;
    text-shadow: 1px 1px white;
}

Replace your favorite color in color field. You can even thicken the shadow by increasing the pixels.

But you need to wait some time. Try using another theme for a while after overriding it. You can also try killing nautilus using nautilus -q and starting it again.

Here is a screenshot after changing the font color in Adwaita.

gnome-shell-desktop with default adwaita theme


Here is some useful links I visited about this problem. It may help future visitors.

Solution 2

Desktop icon text is handled by .nautilus-desktop.nautilus-canvas-item. It is very simple to customize.

In your main GTK theme's gtk.css, underneath the initial @import url line (and not before, in my testing), put:

.nautilus-desktop.nautilus-canvas-item {
color: #ffffff;
text-shadow: 1 1 alpha (@fg_color, 0.8);
}

To see changes, do killall nautilus followed by nautilus and take a look at the Desktop.

Customize as you like: change color to #000000 for black, or, see if the (optional) text-shadow line (with nice alpha transparency) that I've included helps itself, even with white color!

For further ideas, try googling ".nautilus-desktop.nautilus-canvas-item" to see what others have done with this entry. I'm no expert at CSS or the above text-shadow code.

The other neat thing to customize the desktop icon text (and this customization is immediate with no nautilus restart required), is:

The dconf value org.gnome.nautilus.desktop font. To make text bold, simply put Bold as its value (default is empty). To change font size, add a number in there also, e.g. Bold 10. Font can be changed too, e.g. Serif Bold 10 - and I wonder what else can too.

Lastly, changing the icon view size in general via Nautilus preferences, View, 'Icon view Defaults' may make any of the above customizations more palatable by how much text width area it gives (for me, 50% zoom works VERY nicely with Bold 10 in dconf and the example css in gtk.css).

N.b. I'm in Debian Wheezy 7.8 so I hope it's not too different from Ubuntu itself here! I don't think there are any differences at time of writing.

Solution 3

For those who are using Ubuntu 20.04 LTS with the Mate desktop: The solution by Anwar ALMOST works. But just replacing nautilus-desktop with caja-desktop does the trick!

The file to change is the same:

~/.config/gtk-3.0/gtk.css

Modification:

.caja-desktop.caja-canvas-item {  
    color: black;  
    text-shadow: none;  
}
Share:
20,144

Related videos on Youtube

labarna
Author by

labarna

Updated on September 18, 2022

Comments

  • labarna
    labarna over 1 year

    Gnome-shell's desktop is unusable with any light colored wallpaper as the icon names (also white) are unreadable. There doesn't seem to be anyway to change their color, changing various themes doesn't seem to help either.

    Example:

    White text on a white background

    • Rmano
      Rmano about 10 years
      Try to see if editing /usr/share/gnome-shell/theme/gnome-shell.css can help. If yes, you can try to design a user theme... (there is a color: white for the default font just at the start, but I do not know if it's just the panel or it spans to desktop icons).
    • Anwar
      Anwar over 7 years
      @artfulrobot I can see a shadow of texts in 16.04 and it helps reading the text at least a bit. And not like the screenshot
    • artfulrobot
      artfulrobot over 7 years
      I've tried several backgrounds, many leave the text unreadable. I have a mostly black background now, shadow is not helping.
  • artfulrobot
    artfulrobot over 7 years
    Thanks, bounty given! This works, but it's pretty faffy getting the changes to show. Some combination of nemo -q (quit nemo) and reload, and log out and log in etc. etc. seems to get them to show. Anyway, thanks, now I can read the icons on my desktop!
  • Anwar
    Anwar over 7 years
    @artfulrobot Glad to know. I cursed Gnome devs several times while searching for a clue! Don't know why they break between every releases. I also heard that, the class names could be changed in future gnomes :(
  • Michael Cole
    Michael Cole about 7 years
    nemo -q && nemo &; nautilus -q && nautalis &; alt-f2 r worked for me.
  • Michael Cole
    Michael Cole about 7 years
    If you want to change the size, use gnome-tweak-tool
  • Cerin
    Cerin over 6 years
    "In your main GTK theme's gtk.css" Where is this?