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.
does ~/.config/mimeapps.list exist? (if so, that is prefered)
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.