I had that problem too some months ago, and I remember I had to delete some .desktop
files that were inside the $HOME/.local/share/applications
folder.
I think you should delete any file that has notepad
as part of its name, and also you should try to delete (or move somewhere else) the files wine-extension-*
.
A link to a “similar question” (xdg-open default applications behavior – not obviously related, but some experimentation showed that the behaviour is indeed equivalent to the one of xdg-open
) led me deeper down the rabbit hole. While Firefox does not rely on, or inherit rules from, xdg-open
, it uses the MIME specification files just as xdg-open
does.
On a user basis, the MIME opening behaviour is configured by the specification file ~/.local/share/applications/mimeapps.list
.
For me, this file contains just a few reasonable protocols and HTML (and similar) files connected to userapp-Firefox-??????.desktop
, but you could easily add a line like
application/pdf=evince.desktop
to solve that problem on a per-user basis. If the file does not exist yet, make sure to add a section header, such as
[Default Applications]
application/pdf=evince.desktop
Deeper down, the mime types are defined in /usr/local/share/applications/mimeinfo.cache
(this may be /usr/share/…
if you are not on a FreeBSD system), which does list application/pdf=inkscape.desktop;evince.desktop;
. Both evince.desktop
and inkscape.desktop
in that folder contain MimeType=[…]application/pdf;[…]
.
The mimeinfo.cache
is automatically generated from the mime types listed in the .desktop
files without any well-defined order, so you will have to either remove the PDF mime type from Inkscape and regenerate the cache using update-mime-database
, or generate a mimeapps.list (either globally in /usr/local/share/applications/
, or for your user in ~/.local/share/applications/mimeapps.list
).
Best Answer
I had this problem with Calibre, and found a solution in this article by Jacek Bzdak. It's necessary to change the mimetype association for xdg-utils, which is the tool Calibre uses to open files:
Get the mimetype of your problematic file, which can be done with one of xdg-utils commands,
xdg-mime
:xdg-mime query filetype <filename>
Find the
.desktop
file for the application you want to use. In *buntu they should be in/usr/share/applications
.Assign this file as a default:
xdg-mime default myapp.desktop application/x-whatever
(it doesn't need a absolute/relative path, just a.desktop
filename)(Unlikely to help you, two years later, but it was one of the top google results for me, so maybe someone else will find this useful.)
EDIT: fixed missing
default
keyword, thanks @Marco Sulla.