Changing MIME Type
First check the MIME type of the file in question:
mimetype -b the-file.xyz
You’ll get something like application/pdf
. Keep it in mind and open ~/.config/mimeapps.list
.
In [Default Applications]
add:
[Default Applications]
application/pdf=pdfviewer.desktop
To confirm, you can run this command on a file for which you changed the default application:
xdg-mime query default $(mimetype -b the-file.xyz)