Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: HOWTO : Disable Multiple Instances of VLC.

  1. #1
    Join Date
    Nov 2006
    Location
    India
    Beans
    814

    HOWTO : Disable Multiple Instances of VLC.

    Hello people , ive been tired of looking around the Internet for solutions regarding the Multiple Instances of VLC. When i failed , I decided to get a solution. Although Im not very good at shell scripting but i still put together a few lines.


    This Guide is not needed for people Running Intrepid Ibex (Alpha 6 as of now) because the VLC 0.9.2 Grishenko available in the repos allows the option for Disabling Multiple Instances!!!

    Okay , so disable the Multiple Instances of VLC , Follow these Steps :

    1. Open up the Terminal , and type :

    Code:
    gedit vlc.sh
    This will open a new blank file , inside the file , copy and paste the following :

    Code:
    #!/bin/sh
    
    #Script to Disable Multiple Instances of VLC Media Player.
    
    pid=$(pidof vlc)
    
    kill $pid
    
    vlc "$1"
    Save the File and Close it.

    2.Make Script Executable.
    In the terminal , do :
    Code:
    chmod a+x ~/vlc.sh
    3.Change File Associations.

    Right Click a .mp3 file , go to Properties.
    Now click the "Open With" tab.
    Click Add.
    Click "Add a Custom Command".
    Click Browse and select the vlc.sh
    (Its the file u just created in your home directory in Step 1.)
    Click Add.
    Click Close.

    **Do This For all the Extensions you want to Run using VLC , For example ,AVI ,M3U , MPEG , etc **

    That's About it I guess. Now Whenever u new file , VLC will close if its running and play the new item. If you face any issues , bugs or anything Funny , Do Let me Know!

    **If you do Not like it , and want to Revert for reasons unknown **

    Just Change the File Associations
    (the one u changed to vlc.sh in Step 3. back to VLC Media Player)

    Delete the vlc.sh file (It will be in the ~ Folder).

    I Do not think that this file makes any changes to ur system , although if you find so , do let me know.


    Thanks PierreDeKat for the following :

    Optional (Opening files via Browsers Directly)
    :

    Quote Originally Posted by PierreDeKat
    The file associations part works great with regard to browsing and double clicking files in Nautilus, on the desktop, or whatever. But if you want to add this function in Firefox , Seamonkey , etc., you will want to set up the file associations in your browser as well.

    In Firefox, you would go to Preferences->Applications, find and highlight the file type, scroll down to "use other...", browse to your ~/vlc.sh file, click "Open", move onto the next file type, next, next, ..., and then close your Firefox preferences.
    Last edited by ashmew2; September 26th, 2008 at 12:15 PM.
    The truth is always beautiful, no matter how ugly it might seem at first.

  2. #2
    Join Date
    Jul 2008
    Beans
    108

    Re: HOWTO : Disable Multiple Instances of VLC.

    Awesome! Multiple VLCs have been bugging me to death!

    Now then, I haven't tried your patch yet, as I am wondering if you can tell me how to undo it if anything goes wrong.

    Can I manually edit a particular file to do and undo what needs to be done?

  3. #3
    Join Date
    Nov 2006
    Location
    India
    Beans
    814

    Re: HOWTO : Disable Multiple Instances of VLC.

    Hey , Yeah sure ill tell u how to undo , plus ill include it in the HOWTO.
    Thanks for the heads up.

    For Undoing this ,

    Simply remove the file associations
    (Change them to VLC MEDIA PLAYER instead of the vlc.sh).

    Delete the vlc.sh file (in ur home directory).
    The truth is always beautiful, no matter how ugly it might seem at first.

  4. #4
    Join Date
    Jul 2008
    Beans
    108

    Re: HOWTO : Disable Multiple Instances of VLC.

    Okay, works like a charm!

    Just a couple of notes to add:

    1) The file associations part works great with regard to browsing and double clicking files in Nautilus, on the desktop, or whatever. But if you want to add this function in Firefox , Seamonkey , etc., you will want to set up the file associations in your browser as well.

    In Firefox, you would go to Preferences->Applications, find and highlight the file type, scroll down to "use other...", browse to your ~/vlc.sh file, click "Open", move onto the next file type, next, next, ..., and then close your Firefox preferences.

    2) It is possible to name this file ~/.vlc.sh (note the extra period in front of "vlc.sh"). This will make the file invisible to Nautilus, etc., unless you do View->Show Hidden Files. But it does make it trickier to set up the ~/.vlc.sh file as the preferred application, since you have to figure out how to see it in order to select it.

    There are ways to see it, and those methods vary.

    But thanks so much, ashmew2. This fixes a major nuisance for me.

    Edit: Actually what I decided to do instead of hiding my vlc.sh file from Nautilus was to do it a whole lot simpler. I just created a folder in my home directory called "Launchers" and set up my vlc.sh file in there.

    I don't have to see it every time I browse my home folder, but I can find it easily by browsing to my "Launchers" folder. Duh! Sometimes the simplest solutions are the best.
    Last edited by PierreDeKat; August 29th, 2008 at 02:42 PM.

  5. #5
    Join Date
    Nov 2006
    Location
    India
    Beans
    814

    Re: HOWTO : Disable Multiple Instances of VLC.

    Thanks for The Input. And Im Glad I could help.
    The truth is always beautiful, no matter how ugly it might seem at first.

  6. #6
    Join Date
    Aug 2006
    Beans
    382
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HOWTO : Disable Multiple Instances of VLC.

    Or, you could activate two options in VLC's preferences.
    They should be in the interface settings(not completely sure as I'm using 0.9.0).
    One is 'Allow only one running instance'
    and the other is 'Enqueue files in playlist when in one instance mode'

  7. #7
    Join Date
    Oct 2007
    Location
    ISS
    Beans
    1,429

    Re: HOWTO : Disable Multiple Instances of VLC.

    Quote Originally Posted by shirilover View Post
    Or, you could activate two options in VLC's preferences.
    They should be in the interface settings(not completely sure as I'm using 0.9.0).
    One is 'Allow only one running instance'
    and the other is 'Enqueue files in playlist when in one instance mode'
    "One instance open" is in the todo list of vlc 0.9 but I don't think that it's out yet. Where did you get it from?

  8. #8
    Join Date
    Aug 2006
    Beans
    382
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HOWTO : Disable Multiple Instances of VLC.

    In 0.8.6, it's located in the Advanced section.

  9. #9
    Join Date
    Nov 2006
    Location
    India
    Beans
    814

    Re: HOWTO : Disable Multiple Instances of VLC.

    That must be Under Windows ...My VLC still doesnt have any of those options..No one in the Linux Community has those options ..the ones u listed lol...
    The truth is always beautiful, no matter how ugly it might seem at first.

  10. #10
    Join Date
    Nov 2006
    Location
    India
    Beans
    814

    Re: HOWTO : Disable Multiple Instances of VLC.

    Im Running 0.8.6e Janus , Here's a Screenshot of my VLC Advanced Preferences :


    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot.png 
Views:	1397 
Size:	78.7 KB 
ID:	83330  
    The truth is always beautiful, no matter how ugly it might seem at first.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •