Debian/Ubuntu Gnome: Restoring Nautilus as default folder viewer opener

UPDATE 2016-10-21: Consider the newer article on the same topic, which uses xdg-mime.


So, you installed Thunar, PCManFM, Dolphin or Konqueror and now when you doubleclick on a folder on your Gnome desktop (techically, nautilus desktop) or choose a folder in your Gnome panel, you don’t get Nautilus? For all files you can choose the default program to open with, but not so with folder?

Honestly, I don’t know what smartass from Gnome team thought it’s a good idea to honor, occasionally, setting set through external file that specifies which program to use for opening folders … yet to provide no way to change this through GUI. Especially when you already support same thing for all other files!

So let’s change the default folder handler manually!

This problem occured to me a lot of times by now. Solution is quite simple and completely nonintuitive.

Key file is

/usr/share/applications/mimeinfo.cache

This file is one source of information for which program to use to open a specific file type. File types are designated by their mime type. Folders are internally listed as “x-directory/normal” and “inode/directory“. From my experience the latter one is actually being used.

So let’s edit this file. Edit /usr/share/applications/mimeinfo.cache as root. Now, find the line which starts with “inode/directory“. In that line you’ll find “nautilus-folder-handler.desktop;“. Together with the semicolon, move it to be the LAST entry in the line.

Example!

Original line:

inode/directory=pcmanfm.desktop;Thunar-folder-handler.desktop;pcmanfm-find.desktop;pcmanfm-folder-handler.desktop;nautilus-folder-handler.desktop;kde4-dolphin.desktop;kde4-cervisia.desktop;kde4-kfmclient_dir.desktop;kde4-kdesvn.desktop;

Edited line:

inode/directory=pcmanfm.desktop;Thunar-folder-handler.desktop;pcmanfm-find.desktop;pcmanfm-folder-handler.desktop;kde4-dolphin.desktop;kde4-cervisia.desktop;kde4-kfmclient_dir.desktop;kde4-kdesvn.desktop;nautilus-folder-handler.desktop;

I’d now recommend that you restart nautilus. Easiest way is logging out and logging back in.Or run “killall nautilus” from shell; this should shut down nautilus, but the session manager should restart it immediately.

Hope this helps. Questions and comments welcome.


via blog.vucica.net

Leave a Reply

Your email address will not be published.

 

What is 7 + 6 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

This site uses Akismet to reduce spam. Learn how your comment data is processed.