Tag Archives: Gnome

Changing the default file manager away from Nautilus

Nautilus is opening the desktop, making the experience miserable under i3 when all you’re trying to do is ‘view files in directory’.

XFCE’s Thunar is lightweight, and it doesn’t try to create a desktop window.

To get apps such as Chrome to handle “open directory” commands using Thunar, teach xdg-mime about it:

$ sudo apt-get install thunar
$ xdg-mime query default inode/directory
nautilus.desktop
$ xdg-mime default Thunar.desktop inode/directory  # yep, Thunar's desktop file is titlecased on Debian-derived systems
$ xdg-mime query default inode/directory
Thunar.desktop
$ xdg-open .
...thunar opens...

This is sort-of a follow-up to my previous post on this topic. See also, Debian’s article about usage of MIME types.

Getting sound and other panels in gnome-control-center outside GNOME

Missing some panels in gnome-control-center? No “Online Accounts”? No “Sound”?

Apparently, panels are defined through .desktop files in /usr/share/applications (!), and they mostly have the setting of OnlyShowIn=GNOME; or OnlyShowIn=GNOME;Unity;.

To trigger them appearing in, say, i3, xfce or similar, you need to pretend you’re actually running GNOME by exporting the XDG_CURRENT_DESKTOP variable with the value of GNOME.

#!/bin/sh
XDG_CURRENT_DESKTOP=GNOME gnome-control-center

GNOME's disk usage analyzer Baobab in Debian

In case you’re looking for GNOME’s graphical equivalent of “du” command which provides a tree overview of disk usage of each directory, and you are a Debian user, know that program Baobab is located in package gnome-utils.

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.