Author Topic: Make VLC the default media player for video and audio filetypes  (Read 3165 times)

0 Members and 1 Guest are viewing this topic.

Offline Mark Greaves (PCNetSpec)

  • Hero Member
  • *****
  • Posts: 18277
  • Karma: 478
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • Awards
Make VLC the default media player for video and audio filetypes
« on: September 09, 2012, 02:06:31 pm »
To make VLC the default media player for *most* video and audio formats ..
(obviously you'll need to have VLC installed first)

First backup your current users ~/.local/share/applications/mimeapps.list by opening a terminal (Ctrl+Alt+T), and run:
Code: [Select]
cp -vf ~/.local/share/applications/mimeapps.list ~/.local/share/applications/mimeapps.list.backup

Ok now lets add the mimetypes for audio:
Code: [Select]
grep "^MimeType=" /usr/share/applications/vlc.desktop | cut -d "=" -f 2 | xargs -d ';' -n 1 | grep -e "^audio/" -e "^x-content/audio" | xargs -n 1 -I '{}' xdg-mime default vlc.desktop '{}'
and now for video:
Code: [Select]
grep "^MimeType=" /usr/share/applications/vlc.desktop | cut -d "=" -f 2 | xargs -d ';' -n 1 | grep -e "^video/" -e "^x-content/video" | xargs -n 1 -I '{}' xdg-mime default vlc.desktop '{}'

There may be a *few* filetypes that were missed, but those can be added in the normal way -
Right-click on the file, select "Open With", select VLC, and tick the box "Set as default".
But those commands will add all VLC's defaults (as gleaned from the vlc.desktop file) :)



If anything goes wrong .. you can undo this by running:
Code: [Select]
cp -vf ~/.local/share/applications/mimeapps.list.backup ~/.local/share/applications/mimeapps.list
« Last Edit: September 10, 2012, 11:43:22 am by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline BkS

  • BkS Media Founder
  • Hero Member
  • *****
  • Posts: 1691
  • Karma: 49
  • Gender: Male
  • sudo service reality-check start
    • View Profile
    • Awards
Re: Make VLC the default media player for video and audio filetypes
« Reply #1 on: September 09, 2012, 04:20:40 pm »
Now this I can use!
If you try to look through Windows, you can see what the person is doing.
If you try to look through a Penguin, it WILL bite you.

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1833
  • Karma: 142
  • Gender: Male
    • View Profile
    • Awards
Re: Make VLC the default media player for video and audio filetypes
« Reply #2 on: September 09, 2012, 05:30:00 pm »
Very nifty.
I would have gone straight to ~/.local/share/applications/mimeapps.list and manually edited it, but hey I am for simple solutions.
This is to go into my toolbox. ;)

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal