Given xdg-open and an extension, is there a way to get the application which xdg-open is set to for that particular extension?
For example given xdg-open
and .jpg
the result is eog
.
xdg-open
Given xdg-open and an extension, is there a way to get the application which xdg-open is set to for that particular extension?
For example given xdg-open
and .jpg
the result is eog
.
Best Answer
AFAIK the choice of action is based on the file's mimetype rather than its extension.
At least on Ubuntu, you should be able to use the
query
action ofxdg-mime
to show the default application for a specific mimetypeYou can check the mimetype for a particular file using
xdg-mime query filetype
e.g.or using the
file
command e.g.file --mime-type <file>
See
man xdg-mime
for further usage information.