How to configure Linux to open files by extension?
The answer is simple but can't be guessed:
- Create a file named vnc-mime.xml (whatever name, but must obey some patern)
-
Inside the file:
<?xml version="1.0"?> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <mime-type type="application/extension-vnc"> <comment>.vnc file</comment> <glob pattern="*.vnc"/> </mime-type> </mime-info>
- Run
"xdg-mime install vnc-mime.xml"
as the local user. (or as root for the settings to be system-wide? Not tested) - The mime type is now registered. Use your favorite file manager to select the program you want to run (with "Open as...")