Problems with using xdg-mime default. The default was successfully set but it is not used via xdg-open
In my case the change wouldn't work:
$ xdg-mime default evince.desktop application/pdf
Running with debugging on will show you the files queried:
$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/pdf
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/share//applications/defaults.list and /usr/share//applications/mimeinfo.cache
libreoffice-draw.desktop
Looking in that last file (where the match was found) gave me a hint:
$ grep application/pdf /usr/share/applications/mimeinfo.cache
application/pdf=libreoffice-draw.desktop;gimp.desktop;org.gnome.Evince.desktop;inkscape.desktop;
It's not called evince.desktop
anymore, now it's org.gnome.Evince.desktop
!
Once again, now using the new name:
$ xdg-mime default org.gnome.Evince.desktop application/pdf
$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/pdf
Checking ~/.config/mimeapps.list
org.gnome.Evince.desktop
Much better!
For me, further to running xdg-mime default caja.desktop inode/directory
, it was running
update-desktop-database ~/.local/share/applications/
which finally updated the default application.
After this, running xdg-mime query default inode/directory
now showed the new default application.