Adds 2 scripts to make vlc the default audio/video mime-type handler on freedesktop...
authorRafaël Carré <funman@videolan.org>
Mon, 10 Sep 2007 03:43:27 +0000 (03:43 +0000)
committerRafaël Carré <funman@videolan.org>
Mon, 10 Sep 2007 03:43:27 +0000 (03:43 +0000)
share/utils/audio-vlc-default.sh [new file with mode: 0755]
share/utils/video-vlc-default.sh [new file with mode: 0755]

diff --git a/share/utils/audio-vlc-default.sh b/share/utils/audio-vlc-default.sh
new file mode 100755 (executable)
index 0000000..2b08fec
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id $
+#
+# Copyright © 2007 VideoLAN team
+#
+# Authors: http://forum.videolan.org/viewtopic.php?f=13&t=40560
+#          Rafaël Carré <funman@videolanorg>
+#
+# Sets VLC media player the default application for audio mime types
+# on a freedesktop compliant desktop
+#
+
+MIME_FILE=~/.local/share/applications/defaults.list
+
+if [ ! -f $MIME_FILE ]
+    then echo "[Default Applications]" > $MIME_FILE
+    else grep -v 'audio/' $MIME_FILE > /tmp/vlc.defaults.list.tmp
+    mv /tmp/vlc.defaults.list.tmp $MIME_FILE
+fi
+
+ls /usr/share/mime/audio/* | sed -e 's@/usr/share/mime/@@' -e 's/\.xml/=vlc.desktop/' >> $MIME_FILE
diff --git a/share/utils/video-vlc-default.sh b/share/utils/video-vlc-default.sh
new file mode 100755 (executable)
index 0000000..a9338f6
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id $
+#
+# Copyright © 2007 VideoLAN team
+#
+# Authors: http://forum.videolan.org/viewtopic.php?f=13&t=40560
+#          Rafaël Carré <funman@videolanorg>
+#
+# Sets VLC media player the default application for video mime types
+# on a freedesktop compliant desktop
+#
+
+MIME_FILE=~/.local/share/applications/defaults.list
+
+if [ ! -f $MIME_FILE ]
+    then echo "[Default Applications]" > $MIME_FILE
+    else grep -v 'video/' $MIME_FILE > /tmp/vlc.defaults.list.tmp
+    mv /tmp/vlc.defaults.list.tmp $MIME_FILE
+fi
+
+ls /usr/share/mime/video/* | sed -e 's@/usr/share/mime/@@' -e 's/\.xml/=vlc.desktop/' >> $MIME_FILE