You can use the xdg-mime
utility to query the default mime-type associations and change them.
xdg-mime query default video/mp4
Will return the .desktop
file associated with the default app to open mp4 files. To change the default association:
xdg-mime default vlc.desktop video/mp4
you need to specify the desktop
file to open files of the specified mime type. To check the mime-type of a given file, use
file -ib filename
thank a lot!
Thanks. That said, no need to use file to get an application MIME file type here, since that also can be done with xdg-mime, using «query filetype» :
$ xdg-mime query filetype /path/to/some_file.mkv
video/x-matroska
And if you do the same with file -ib, you get…
$ file -ib /path/to/some_file.mkv
text/html; charset=us-ascii
which is… just wrong