Sample Header Ad - 728x90

How to set the default application to open folders?

5 votes
1 answer
2384 views
I'm really stuck; I want to add Open with vs code to the folders context menu following the same approach as for files by means of the so-called MIME; editing the file ~/.config/mimeapps.list allows me to change default applications for different file extensions. My preferred default application is VS Code; I found inode/directory is the file type for a directory in MIME, so I added this line inode/directory=code-insiders.desktop to the file ~/.config/mimeapps.list in [Default Applications] field but Open with vs code doesn't show as I right-click on folders. I can confirm what I did makes sense by showing the output of this command gio mime inode/directory:
Default application for “inode/directory”: code-insiders.desktop
Registered applications:
	code-insiders.desktop
	org.gnome.Nautilus.desktop
	org.gnome.baobab.desktop
Recommended applications:
	code-insiders.desktop
	org.gnome.Nautilus.desktop
	org.gnome.baobab.desktop
Similarly, the output of gio mime text/plain by which the corresponding files context menu appears Open with vs option is
Default application for “text/plain”: code-insiders.desktop
Registered applications:
	code-insiders.desktop
	libreoffice-writer.desktop
	org.gnome.gedit.desktop
	vim.desktop
Recommended applications:
	code-insiders.desktop
	libreoffice-writer.desktop
	org.gnome.gedit.desktop
	vim.desktop
The default application for opening text files by right-clicking shows Open with vs but not the case for folders.
Asked by EnthusiastiC (163 rep)
Oct 28, 2022, 10:25 AM
Last activity: May 11, 2025, 05:03 AM