Nautilus tree patch :
Add everything you want to the multi rooted tree in nautilus.

What ?

This page describe how to have a multi rooted tree in nautilus. I'm using nautilus in the old way style (ie not in spatial mode, i don't like it, but the debate isn't there). By default in nautilus, you will find in the tree view "Home folder", "File System" and if you have mountable media, they will appear when mounted. The patch you will find here gives you a way to add everything you want in the nautilus tree view.

How does it look ?

Here is a screenshot showing multi rooted tree view : Screenie

How does it work ?

Tree view is managed in the file nautilus-2.6.*/src/file-manager/fm-tree-view.c. Near to the line 1066 you will find a piece of code which is looking for items to add in the tree view. It's a function called "create_tree" (static void create_tree (FMTreeView *view)). That I propose is to modify this function to read a file in your home directory (called ~/.nautilus-bookmarks. Each lines of this file gives a new item to add to the tree. Each line will be writen like this :

/mnt/foo|Foo dir|gnome-folder
/mnt/bar|Bar dir|gnome-folder

In order you write the path, the item name, an icon name (look in the gnome icon theme dir to find the rights names). These three thing are separated by a pipe.

UPDATE 7th june : I just improve the patch to sync the content tree with the new gtk file chooser (Screenie). The patch makes nautilus read the file ~/.gtk-bookmarks which is used by the gtk file chooser. There is no need to manually edit this file, simply use the gtk file chooser bookmark management.

By default, nautilus will read ~/.nautilus-bookmarks. If not existing it looks on ~/.gtk-bookmarks. If both doesn't exist no bookmarks will be used.

Patching the stuff :)

Here is the patch file to use : nautilus-multi-root-treeview-0.3.patch. Unpack nautilus source, patch this file, compile, install. Last thing, create a file called .nautilus_tree in your home, add the place you want see and enjoy ;)

Using debug output

Since patch 0.3 you can enable debug output. Before using nautilus, you just have to set a variable called _DEBUG_TREE like that :

$> export _DEBUG_TREE=1

Future and todo

I need to find a way to sort the tree contents (you can notice in the screenie that "Download*" item aren't sorted.
Having a gui to add root would be a good thing ?

Changelog

Download

Contact me

kik0rZDONOTSPAMfree.fr (replace DONOTSPAM string with @)