Default video player in Linux

Just a quick memo on how to make mplayer the default videoplayer in Linux:

1xdg-mime default mplayer.desktop application/vnd.rn-realmedia application/x-extension-mp4 application/x-flash-video application/x-matroska application/x-quicktime-media-link application/x-quicktimeplayer text/google-video-pointer text/x-google-video-pointer video/3gpp video/dv video/fli video/flv video/mp4 video/mp4v-es video/mpeg video/msvideo video/quicktime video/vivo video/vnd.divx video/vnd.rn-realvideo video/vnd.vivo video/x-anim video/x-avi video/x-flc video/x-fli video/x-flic video/x-m4v video/x-matroska video/x-mpeg video/x-ms-asf video/x-msvideo video/x-ms-wm video/x-ms-wmv video/x-ms-wmx video/x-ms-wvx video/x-nsv video/x-ogm+ogg video/x-theora+ogg

This of course depends on your system actually having a desktop file for MPlayer (which the mplayer-nogui package in Ubuntu doesn't), so if your system doesn't have it (check /usr/share/applications/), you can copy the following to .local/share/applications/mplayer.desktop in your home directory:

1[Desktop Entry]
2Version=1.0
3Type=Application
4Encoding=UTF-8
5Name=MPlayer
6Comment=Play multimedia files and media
7GenericName=Media Player
8Exec=mplayer %U
9Icon=mplayer
10NoDisplay=true
11MimeType=application/vnd.rn-realmedia;application/x-extension-mp4;application/x-flash-video;application/x-matroska;application/x-quicktime-media-link;application/x-quicktimeplayer;text/google-video-pointer;text/x-google-video-pointer;video/3gpp;video/dv;video/fli;video/flv;video/mp4;video/mp4v-es;video/mpeg;video/msvideo;video/quicktime;video/vivo;video/vnd.divx;video/vnd.rn-realvideo;video/vnd.vivo;video/x-anim;video/x-avi;video/x-flc;video/x-fli;video/x-flic;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-ms-asf;video/x-msvideo;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-nsv;video/x-ogm+ogg;video/x-theora+ogg;

Afterwards, you might need to run

1update-desktop-database ~/.local/share/applications

and log out and in again.... mimetypes are a bit magic...