Ubuntu – How to theme the Nautilus background image

customizationgtk3nautilusthemes

I want to change the background image in the Nautilus file browser. My idea is to put my own style in the background. I'm using Ubuntu 11.10 and Nautilus is version 3.

I know that I have to change the nautilus.css file of the theme, but the problem is that there is not a parameter for the background. I just want to apply an image but I can't find the file or parameter to change it.

The CSS file is in the directory /home/UserName/.theme/MyTheme/gtk-3.0/apps. I've changed the nautilus.css file. I wrote two new lines using CSS style but I don't know where the correct place is to put it. The lines are:

background-image: url("carbon.jpg");
background-repeat: repeat;

Obviously I put the image called carbon.jpg in the same directory of nautilus.css, but this change doesn't work because I need to know whichs class displays the Nautilus file browsing frame. If I find this class I guess that this code will work.

If someone knows how to do it, please tell me because I really want to make this change.

Best Answer

  1. Open the file /usr/share/themes/MyTheme/gtk-3.0/apps/nautilus.css (Requires root permission).
  2. Add this line:

    NautilusWindow * {background-image:url("bg.jpg");}

    where bg.jpg is the background image you want to display.

  3. Run nautilus -q to kill all open file browsers.

  4. Run nautilus.

This will apply background to all classes present inside NautilusWindow.You can identify the classes where you don't want to apply background and add background-image:none;
Example:

NautilusWindow .sidebar,
NautilusFloatingBar,
NautilusWindow .sidebar .view {
    background-image: none;
}