Change default applications used by gnome-open, exo-open, xdg-open, gvfs-open and kde-open

11,691

Solution 1

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

Solution 2

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

Solution 3

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.

Share:
11,691

Related videos on Youtube

student
Author by

student

Updated on September 18, 2022

Comments

  • student
    student over 1 year

    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?