Please read http://budts.be/weblog/2011/07/xdf-open-vs-exo-open first.
If you've read the link you understand xdg-open should work on any Desktop Environment. You may however wish to alter this article for your specific D.E.
First is a script that will display every app option for every mime-type on your system.
for dd in /usr/share/applications ~/.local/share/applications; do
for d in $(ls $dd 2>/dev/null | grep "\\.desktop$" 2>/dev/null); do
for m in $(grep MimeType $dd/$d | cut -d= -f2 | tr ";" " "); do
echo xdg-mime default $d $m;
To use this copy paste into a file named mimetypes.sh, then make it executable with
chmod +x mimetypes.sh
Now run it:
You will of course see all options.
Suppose you only want to see video mime-types. Try:
./mimetypes | grep video
(Just ignore any output that begins with "grep:", the usefull ones are only the ones that begin with "xdg-mime".)
Now suppose you have vlc installed and it is the only video player you want as a default. Highlight all the lines that contain vlc (the whole code block) from your results and paste them into the bash prompt. Voila, vlc is now your default player for all video mime-types.
Suppose you have firefox and you like it best. But for whatever reason chromium is still the default when launching links or html files.
./mimetypes.sh | grep html | grep firefox
you should see something like:
xdg-mime default firefox.desktop text/html
xdg-mime default firefox.desktop application/xhtml+xml
Copy those two lines and paste into your bash shell. Now Firefox should be your default.