Ubuntu – how to change background of nautilus in ubuntu 14.04

14.04nautilusnautilus-actionsthemes

As the question goes, How can I change the background of nautilus in Ubuntu 14.04 ??

I have already tried dconf-editor, gtk-tweaker, gnome-tweaker. They change the color of some parts of some pannel but not the background of nautilus in icons view.

Best Answer

You can edit the gtk-main.css or nautilus.css files.

I recommend you to try this under your ~/.themes and not system-wide. You may either change the background color of nautilus only or the base theme as a whole, which affects a lot more programs. In this example I will change the background color in the default Ubuntu Theme "Ambiance" (in Ubuntu Gnome use the folder Default instead) from white (#ffffff) to a light grey (#D8D8D8). Feel free to pick any other color.

For comparison how it looks like in the beginning: Natuilus css file

Create a copy in ~/

Create your ~/.themes directory and copy the original Ambiance theme to it.

mkdir ~/.themes
cp -R /usr/share/themes/Ambiance ~/.themes/

Change the background color for the whole theme

If you want to change the base color for the whole theme, edit the base_color (Hex notation #??????) in gtk-main.css. This changes the background color of other applications (eg: gedit) as well.

nano ~/.themes/Ambiance/gtk-3.0/gtk-main.css

Change this line:

@define-color base_color #ffffff;

For this one:

@define-color base_color #D8D8D8;

To save the changes in nano, press Ctrl+O,Enter then Ctrl+X.

Effect: Background color for the whole theme

Change the background color for nautlius only

If you want to change the background color for nautilus, edit nautilus.css.

nano ~/.themes/Ambiance/gtk-3.0/apps/nautilus.css

Add this lines to the beginning of the file.

 NautilusWindow * .view {
     background-color: #D8D8D8; 
}

Natuilus css file

To save the changes in nano, press Ctrl+O,Enter then Ctrl+X.

Effect

Background color for nautilus only

To see the changes you can restart nautilus, logout login or restart your machine.