Change The Default File Manager
It is a given that not all Linux users want to use the same file manager, and wish to change the default file manager. Other users however may be content with their file manager, but are experiencing the issue of directories are not opening in the desired file manager. In either case, these situations can be easily remedied. First let’s begin explaining a few things, before we change the default manager.
File Association
An application is associated to files or content by using what is called MIME type or also known as a media type. When an application is installed MIME types are set automatically, and updated when a software update is applied. Think of it like map that gives the system directions on what program opens a particular file. In the case of file manager the MIME type is called “inode/directory”. Any application set as default that is associated to this MIME type, and will be opened as the file manager even if the application itself is not actually a file manager. Such applications that are known to be set as the file manager can be Audacious, VSCodium, Kitty, etc.
What Is A Desktop Entry File?
A way to integrate an application into menus of a Linux desktop environment that follow the standard XDG Desktop Menu specification. Think of these files like a shortcut providing all the information needed to work seamlessly.
Find The Default File Manager
To determine the default file manager run the following command.
$ xdg-mime query default inode/directory
codium.desktop
Change The Default File Manager
In order to change the default manager you have to know what the desktop entry file name is called. Desktop entry files are typically stored at a couple location on a Linux system, “~/.local/share/applications/” for user-specific applications, and “/usr/share/applications/” or “/usr/local/share/applications/” for applications installed system-wide. Try locating the application name by browsing each of those directories listed or searching by using the find command.
Here is an example of a search for GNOME Files (nautilus) within the directory “/usr/share/applications/”.
$ find /usr/share/applications/ -iname "*nautilus*"
/usr/share/applications/nautilus-autorun-software.desktop
/usr/share/applications/org.gnome.Nautilus.desktop
The below command example will set GNOME Files (nautilus) as the default file manager.
$ xdg-mime default org.gnome.Nautilus.desktop inode/directory
To verify if the change worked, you can run the following command.
$ xdg-mime query default inode/directory
org.gnome.Nautilus.desktop
More Examples
Here are some more examples of other file managers, and how to change them to be the default.
Dolphin
$ xdg-mime default org.kde.dolphin.desktop inode/directory
Double Commander
$ xdg-mime default doublecmd.desktop inode/directory
or;
nano ~/.config/mimeapps.list
Scroll down to inode/directory
under [Added Associations]
, as well under [Default Applications]
, and ensure that the line(s) read:
inode/directory=org.gnome.Nautilus.desktop
for d3lphin
xdg-mime default d3lphin.desktop inode/directory
nano ~/.local/share/applications/mimeapps.list
[Default Applications]
inode/directory=d3lphin.desktop;
x-scheme-handler/file=d3lphin.desktop;
application/vnd.debian.binary-package=appsetup2.exu.desktop;
application/vnd.flatpak.ref=appsetup2.exu.desktop;
application/x-deb=appsetup2.exu.desktop;
....
nano ~/.config/mimeapps.list
[Default Applications]
inode/directory=d3lphin.dektop
x-scheme-handler/http=google-chrome.desktop
x-scheme-handler/https=google-chrome.desktop
text/html=google-chrome.desktop
application/excel=planmaker-18.desktop
application/mspowerpoint=presentations-18.desktop
application/msword=textmaker-18.desktop
application/powerpoint=application/mspowerpoint
application/ppt=presentations-18.desktop
application/rtf=textmaker-18.desktop
...
sudo cp /opt/trinity/share/applications/tde/d3lphin.desktop /usr/share/applications/
sudo nano /usr/share/applications/d3lphin.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Dolphin
Name[ar]=الدولفين
Name[lv]= Dolphin
Name[ne]=डलफिन
Name[pa]=ਡਾਲਫਿਨ
Name[sr]=Делфин
Name[sr@latin]=Делфин
Name[uk]=Дельфін
Exec=/opt/trinity/bin/d3lphin %u
Icon=/opt/trinity/share/icons/d3lphin.png
Icon=d3lphin
Type=Application
X-DocPath=d3lphin/index.html
Categories=Qt;TDE;System;FileManager;
GenericName=File Manager
GenericName[ar]=مدير الملفات
GenericName[be]=Кіраўнік файла
.....
which d3lphin
/opt/trinity/bin/d3lphin
No comments