How to make VLC (or any player) the default for all video fi

*nix specific usage questions
u-slayer
New Cone
New Cone
Posts: 4
Joined: 09 Sep 2007 23:10

How to make VLC (or any player) the default for all video fi

Postby u-slayer » 09 Sep 2007 23:13

I've searched the forums in the past, trying to find a way to change the default application that opens video files. The best response I ever found was to right click on the files and manually change the properties.

I find this method slow and tedious. There are 19 different types of video files. Therefore, I have automated the whole thing. ONE line in the terminal will change ALL of your video files so that they open with vlc

Code:

Code: Select all

cd /usr/share/mime ls video/* | sed 's/.xml/=vlc.desktop/' | tee -a ~/.local/share/applications/defaults.list
By the way, this also works for Image, message, multipart, text, audio, packages and video files.

Just change the word 'video' to one of the above options and change vlc to whatever app you like best.

Tell me if this works for you. I only tested it in ubuntu linux.

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: How to make VLC (or any player) the default for all video fi

Postby funman » 10 Sep 2007 00:48

Hi,
Your script is interesting, can we put it in the vlc source tree (under GPL licence, copyrighted by VideoLAN team if you agree) ?

I'd like to make 2, one for audio, one for video (i don't see the interest for other mimetypes)

And by the way the script will work on any distribution that is freedesktop compliant.

thanks

u-slayer
New Cone
New Cone
Posts: 4
Joined: 09 Sep 2007 23:10

Re: How to make VLC (or any player) the default for all video fi

Postby u-slayer » 10 Sep 2007 01:30

Yes, feel free to include it. :D

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: How to make VLC (or any player) the default for all video fi

Postby funman » 10 Sep 2007 05:50

I added it in the tree, and modified it a little bit:
see
http://trac.videolan.org/vlc/browser/tr ... default.sh and
http://trac.videolan.org/vlc/browser/tr ... default.sh
(they are basically the same)

I added a way to keep settings while not duplicating entries (for example on multiple running of the script), and create the config file if it's not present.

thanks for your contribution !

tell me if you think it can be enhanced further

SynUK
New Cone
New Cone
Posts: 1
Joined: 14 Sep 2007 09:49

Re: How to make VLC (or any player) the default for all video fi

Postby SynUK » 14 Sep 2007 09:53

Can you give me any pointers what I am doing wrong when I run your script above. When I run it I get the following error :

Code: Select all

./video-vlc-default.sh: 1: cannot open !DOCTYPE: No such file ./video-vlc-default.sh: 1: html: not found ./video-vlc-default.sh: 2: PUBLIC: not found ./video-vlc-default.sh: 3: Syntax error: newline unexpected
I am running it on a standard install of Ubuntu Feisty Fawn with Beryl added.

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: How to make VLC (or any player) the default for all video fi

Postby funman » 16 Sep 2007 03:36

the link goes to an html webpage with the code
the direct link is http://trac.videolan.org/vlc/browser/tr ... format=txt

(you could have figured that by loading the page in the browser instead of saving it)


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 12 guests