Gentoo default application for opening files

file managementfreedesktopgentoomime-types

On my Gentoo box running without a desktop environment, every time I try to open a file the system tries to open it with Firefox. I understand that without a desktop environment "open file" cannot function correctly, but why is everything opened with Firefox? If I want to, can I change it to something else?

Best Answer

Usually this information is handled in 2 places:

  • Application .desktop files advertise what program can open
  • MIME database which specifies what application should be used to open file with specific MIME

The MIME database can be customized by editing .local/share/applications/mimeapps.list and .local/share/applications/mimeinfo.cache. The tool which allows to edit it is xdg-mime from x11-misc/xdg-utils. Please beware that man states it can be used only from inside desktop session.

Edit Please note that some applications, like Firefox, do not respect the MIME database settings.

Related Question