14

How to change the applications associated with certain file-types for gnome-open, exo-open, xdg-open, gvfs-open and kde-open?

  1. Is there a way by editing config files or by a command-line command?
  2. Is there a way to do this using a GUI?

For both questions: How to do it per user basis, how to do it system-wide?

student
  • 18,305

3 Answers3

6

It's all done with MIME types in various databases. xdg-mime can be used to query and set user values.

5

I had the same problem today, but more towards the gnome/cinnamon side of things.

You can query and change the default mime type like this:

gvfs-mime --query inode/directory

gvfs-mime --set inode/directory nemo.desktop
blueyed
  • 735
vchuravy
  • 151
4

Building on @Ignacio Vazquez-Abrams answer, here are the incantations for the impatient that should cover many typical use cases:

Figure out the mime type of your file:

xdg-mime query filetype somefile.pdf

will result in application/pdf.

Set a default application to handle it:

xdg-mime default qpdfview.desktop application/pdf

where I use qdfview's desktop definition as the program to handle PDFs.

Harald
  • 898