Bug 102063

Summary: xdg-open ignores mimeapps.list
Product: Portland Reporter: Nazar Mokrynskyi <nazar>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: medium    
Version: 1.1.0 rc3   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Nazar Mokrynskyi 2017-08-07 04:29:26 UTC
nazar-pc@nazar-pc ~> cat ~/.local/share/applications/mimeapps.list 
[Default Applications]
inode/directory=nemo.desktop
application/x-gnome-saved-search=nemo.desktop
text/xml=org.gnome.gedit.desktop
video/x-matroska=smplayer.desktop
nazar-pc@nazar-pc ~> xdg-mime query default video/x-matroska
smplayer.desktop

The above is enough to open *.mkv files in Nemo file manager with SMPlayer, but when using xdg-open it still always uses MPV.

Also, `xdg-mime query filetype '/path/to/file.mkv'` doesn't output anything for the files I'm having issues with. So looks like it struggles to determine its mime type, but somehow still manages to select wrong application by guessing.
Comment 1 Rex Dieter 2017-11-29 20:18:58 UTC
does ~/.config/mimeapps.list exist?  (if so, that is prefered)
Comment 2 Rex Dieter 2017-11-29 20:28:13 UTC
Seems to work for me using ~/.config/mimeapps.list :

# current default
$ xdg-mime query default video/x-matroska
org.kde.dragonplayer.desktop

$ echo 'video/x-matroska=smplayer.desktop;' >> ~/.config/mimeapps.list

$ xdg-mime query default video/x-matroska
smplayer.desktop

tested under kde plasma5 and also using 

XDG_CURRENT_DESKTOP=generic DE=generic xdg-mime ...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.