I need to create a script that returns the default app to be used for a given file extension (including the path). I had a look at the file
command which can return the mime type and xdg-open
which would open a file. But what I'd like to get is
myscript doc
/usr/bin/libreoffice
.or.
myscript fun
/opt/acme/roadrunner/meepmeep
How do I do that?
I grabbed a Linux expert in the office and we found a reasonable solution:
Once we figured that there are only 3 locations for the desktop files it was not hard anymore.
The command can be something like:
Result: