This talks about how to allow users to choose their default application when opening certain types of file.
There are many systems, and they have some degree of compatibility.
The best options likely are:
xdg-openis a popular XDG choice.gnome-openGnome specific. Usexdg-openinstead.xdg-openforwards to it in GNOME systems.update-alternativesand/etc/alternativesis an important Linux method of executable selection.
shared-mime-info package.
Some common variables are used by non-graphical systems, e.g. EDITOR and BROWSER.
KDE specific. Use xdg-open instead.