a9338f68b33d5fc6197e053a1db678cbde8ab7fa
[vlc.git] / share / utils / video-vlc-default.sh
1 #!/bin/sh
2 # $Id $
3 #
4 # Copyright © 2007 VideoLAN team
5 #
6 # Authors: http://forum.videolan.org/viewtopic.php?f=13&t=40560
7 #          Rafaël Carré <funman@videolanorg>
8 #
9 # Sets VLC media player the default application for video mime types
10 # on a freedesktop compliant desktop
11 #
12
13 MIME_FILE=~/.local/share/applications/defaults.list
14
15 if [ ! -f $MIME_FILE ]
16     then echo "[Default Applications]" > $MIME_FILE
17     else grep -v 'video/' $MIME_FILE > /tmp/vlc.defaults.list.tmp
18     mv /tmp/vlc.defaults.list.tmp $MIME_FILE
19 fi
20
21 ls /usr/share/mime/video/* | sed -e 's@/usr/share/mime/@@' -e 's/\.xml/=vlc.desktop/' >> $MIME_FILE