How to make VLC my default video application in one command line ?
Just type this long command :
What this command really do ? First, it selects the "Mime Types" block from the vlc.desktop file :grep "^MimeType=" /usr/share/applications/vlc.desktop
Then we remove the "MimeType=" header :cut -d "=" -f 2
We've got all mime types in one line. So, we format the output in this way : 1 line = 1 mime type using ';' as the separator :xargs -d ';' -n 1
Then we only keep all video mime types, throwing away all audio content for instance.grep -e "^video/" -e "^x-content/video"
Finally, all these video mime types are associated with vlc, using the command 'xdg-mime default'