When I do
xdg-open demo.odt
Libre Office opens - as it should. When I do
xdg-open http://askubuntu.com
my browser opens - as it should. But now I'd like to have a command where I do
mime-based-xdg-open http://www.someserver/demo.odt
and Libre Office would open with the URL on the command line. Is there a way to figure out what xdg-open would use for a specific extension or mime-type? Then I could construct a script that does the rest.
Use
to get your desktop's default app for opening files with mime-type
MIMETYPE
To get the mime-type of file
FILE
(not an URL) use