How to change default application for XML files?

Solution 1:

Oh thank god, I have a solution.

First of all the problem is getting caused by "Default Applications" in "Settings" on "GNOME", in order to save the default application for something like browser it overrides whatever it has as default for a set off applications and creates a double entry under ~/.config/mimeapps.list. This way the default application for that mimetype cannot be changed unless you manually delete the entry for it. To do it:

  • edit the file: ~/.config/mimeapps.list
  • find the [Default Applications]
  • delete application/xml, there is a 2nd entry under [Added Associations] which we want to keep
  • save the file and exit
  • go to any xml file and now the default application can be changed by going Right Click > Properties > Open With

This is probably a bug within GNOME.

Solution 2:

You need to change the Default application from defaults.list.

Open the defaults.list file in terminal by

sudo -H gedit /usr/share/applications/defaults.list

Search for xml=firefox if your default browser is Firefox and replace by xml=gedit.

That is

text/xml=firefox.desktop

to

text/xml=gedit.desktop

Enjoy!

Solution 3:

Try one of these pages in the official guides:

  • Ubuntu Desktop Guide

    https://help.ubuntu.com/stable/ubuntu-help/files-open.html

  • GNOME Help

    https://help.gnome.org/users/gnome-help/stable/files-open.html