3

Context: I have an Ubuntu/Dolphin misbehaviour where it seems to think *.mkv files are opened with ark. The below screenshot indicates opening the Properties dialog then clicking File Type Options

enter image description here

Note that the order of preference is Ark, GIMP, VLC. If I try to rearrange these using the UI and press OK, the changes do not take effect -- reopening the dialog shows the previous associations & ordering, and rebooting does not pick up any changes.

A little research tells me that the file associations are stored in one of these files, depending on what *nix you are running:

/usr/share/applications/defaults.list
/usr/share/applications/mimeapps.list
/usr/local/share/applications/defaults.list
/usr/local/share/applications/mimeapps.list
$HOME/.local/share/applications/defaults.list
$HOME/.local/share/applications/mimeapps.list

On my Ubuntu system, only the following two files exist.

  1. /usr/share/applications/defaults.list
  2. $HOME/.local/share/applications/mimeapps.list

Investigating...

$> grep matroska {/usr,/usr/local,$HOME/.local}/share/applications/{defaults,mimeapps}.list 2>/dev/null                                                                                                                               
/usr/share/applications/defaults.list:application/x-matroska=org.gnome.Totem.desktop
/usr/share/applications/defaults.list:audio/x-matroska=org.gnome.Totem.desktop
/usr/share/applications/defaults.list:video/x-matroska=org.gnome.Totem.desktop
$HOME/.local/share/applications/mimeapps.list:video/x-matroska=vlc.desktop;org.kde.ark.desktop;gimp.desktop;
$HOME/.local/share/applications/mimeapps.list:video/x-matroska=vlc.desktop;

This seems to indicate that ark is not the first priority file association for *.mkv files. This is also the only occurrence of the string ark in any of these files, and there are no occurrences of the string mkv.

From this I conclude that Dolphin is finding its file associations from something other than the above listed files.

What did I miss?

1 Answer 1

1

You are missing the main default location for user-specific mimetype associations:

~/.config/mimeapps.list

or, more generally:

$XDG_CONFIG_HOME/mimeapps.list

where $XDG_CONFIG_HOME is ~/.config/ by default.

But don't feel bad: you are in good company. This location has been the standard for many years, but unfortunately many applications still use the old locations, causing much confusion and strife. Here's an excerpt from the FreeDesktop standard:

The lookup order for this file is as follows:

$XDG_CONFIG_HOME/$desktop-mimeapps.list            user overrides, desktop-specific (for advanced users)
$XDG_CONFIG_HOME/mimeapps.list                     user overrides (recommended location for user configuration GUIs)
$XDG_CONFIG_DIRS/$desktop-mimeapps.list            sysadmin and ISV overrides, desktop-specific
$XDG_CONFIG_DIRS/mimeapps.list                     sysadmin and ISV overrides
$XDG_DATA_HOME/applications/$desktop-mimeapps.list for completeness, deprecated, desktop-specific
$XDG_DATA_HOME/applications/mimeapps.list          for compatibility, deprecated
$XDG_DATA_DIRS/applications/$desktop-mimeapps.list distribution-provided defaults, desktop-specific
$XDG_DATA_DIRS/applications/mimeapps.list          distribution-provided defaults

https://specifications.freedesktop.org/mime-apps-spec/1.0.1/ar01s02.html

By the way, ~/.local/share/applications/defaults.list has been deprecated for even longer than ~/.local/share/applications/mimeapps.list.

Personally I always thought that defaults.list was the global file, because that's what the Debian GNOME Team is using to set their default applications for the users And that mimeapps.list in user's own local directory was to override that global defaults.list I see now I was wrong, and that mimeapps.list can also be used globally and that Debian still using defaults.list is just for historical reasons

Xfce's utilities modify mimeapps.list at users directory when defining preferred applications / file associations I would expect GNOME to do same thing thesedays

So heck, just to drop the confusion, could the defaults.list be declared obsolete somewhere so that the confusion stops?

https://lists.freedesktop.org/archives/xdg/2014-February/013182.html

Further information:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .