Which default.list should I modify for default applications and what are the differences between the two?

I would like to add miro to the default application GUI in system settings/default applications. I added ;miro.desktopnext to all rhythmbox.desktop entries eventually discovering if it was not added to audio/x-vorbis+ogg=rhythmbox.desktop as audio/x-vorbis+ogg=rhythmbox.desktop;miro.desktop it would not appear in the system settings/default applications drop down list for audio.

I can find default.list in either

  • /etc/gnome/defaults.list or
  • /usr/share/applications/defaults.list

Modifying either gives me the same results.

Further reading and i found that GNOME splits the settings for default application in system-wide and user specific settings.

  • System wide application assignments can be found in /etc/gnome/defaults.list.
  • User specific in ~/.local/share/applications/defaults.list.

So i understand that if i right click/open with/set as default it will make changes to my ~/.local/share/applications/mimeapps.list and will be associated with that user. I suppose i could even create a defaults.list in ~/.local/share/applications/ but since both changes made in /usr/share/applications/defaults.list and /etc/gnome/defaults.list are system wide i'm not sure which is the correct way. What is the difference between the two and which is the correct list to modify?


Solution 1:

First thing:

/usr/share/applications/defaults.list

is a symbolic link to

/etc/gnome/defaults.list

Second thing:

"*.desktop" files contains in it the mime-types that the program supports. So if "miro" application can handle "audio/x-vorbis+ogg" mime-type files, "miro.desktop" should contain this mime-type in it. Then "miro" application will appear as a candidate to run this mime-type files.

Third thing:

If there are more than one application supporting the same mime-type, you can decide which one will be used by default just including it at "/usr/share/applications/defaults.list", so in this case just replace:

audio/x-vorbis+ogg=rhythmbox.desktop

with:

audio/x-vorbis+ogg=miro.desktop

It CANNOT be two "defaults" applications.

Solution 2:

If you want to have your changes show up in System Settings, then you will have to edit /etc/gnome/defaults.list.

gksudo gedit /etc/gnome/defaults.list 

If you press Ctrl+H, it will bring up a dialog for search and replace. In Search for, enter:- rhythmbox. In Replace with, enter:- miro.

And either log-out or reboot and you will have replaced all instances of Rhythmbox with Miro. You can of course do this manually if you want to keep some of Rhythmbox's defaults.

Also anything you do in .local/share/applications/mimeapps.list will only be for that user.