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
.
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 of xdg-mime
to show the default application for a specific mimetype
$ xdg-mime query default image/jpeg
eog.desktop
You can check the mimetype for a particular file using xdg-mime query filetype
e.g.
$ xdg-mime query filetype kqDRdnW.jpg
image/jpeg
or using the file
command e.g. file --mime-type <file>
See man xdg-mime
for further usage information.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다