how to change background of nautilus in ubuntu 14.04

22,002

Solution 1

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.

Solution 2

Roman's solution will work, but actually there's no need to copy the entire Ambiance theme to your .themes directory. Instead, you can simply create a file ~/.config/gtk-3.0/gtk.css and put any changes you want there, such as

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

Then restart Nautilus. The definition in your gtk.css file will override the theme defaults and you'll see the background color you wanted.

Solution 3

Just change the system appearance to dark:

System -> Appearance -> Dark

Nautilus will inherit the color scheme.

Share:
22,002

Related videos on Youtube

Vahid Nateghi
Author by

Vahid Nateghi

Updated on September 18, 2022

Comments

  • Vahid Nateghi
    Vahid Nateghi almost 2 years

    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.

    • Rinzwind
      Rinzwind about 10 years
      As far I know the dconf method does no longer work as of version 3.8 :(
  • Rinzwind
    Rinzwind about 10 years
    Hmm those do not change the nautilus background.
  • Vahid Nateghi
    Vahid Nateghi about 10 years
    Is there a reference to which I can refer to for further change in theme? (specially nautilus) for example how can I change color of icon text, or the color of the icon when selected, etc.?
  • thorstorm
    thorstorm about 10 years
    Some themes do change the Nautilus background. I'm using one that does.
  • Roman Raguet
    Roman Raguet about 10 years
    @VahidNateghi: Not exaclty a list, but you can view the structure of the default themes in ubuntu (Ambiance), and here you have a link to a basic gtk3 theming guide worldofgnome.org/making-gtk3-themes-part-1-basics and this link is for gnome developer for GtkCssProvider (selector, widget classes) developer.gnome.org/gtk3/3.4/GtkCssProvider.html .hope this helps.
  • Caleb
    Caleb about 8 years
    @VahidNateghi I was able to successfully change the color of the icon text by adding color: #FFF; to the above styles
  • Patrick Da Silva
    Patrick Da Silva over 7 years
    Is there somewhere where I can see how to change the other parameters? Some kind of list where I could try playing with the hexa-decimal colors? I managed to do your solution but I want to learn how to change the rest of the colors, not just the background one. +1
  • MERose
    MERose over 7 years
    In 16.04 the file has been moved to /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css.
  • pretzlstyle
    pretzlstyle over 6 years
    What about changing the color of the side panel as well?
  • pretzlstyle
    pretzlstyle over 6 years
    What about changing the color of the side panel?
  • Angsuman Chakraborty
    Angsuman Chakraborty almost 3 years
    This is the simplest solution and should be the selected answer.