Disable the Multiple Instances of VLC , Follow these Steps
1. Open up the Terminal , and type :
gedit vlc.sh
This will open a new blank file , inside the file , copy and paste the following :
#!/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 :
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 **
Now Whenever u new file , VLC will close if its running and play the new item.
**If you do Not like it , and want to Revert for reasons unknown :P **
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).
Optional (Opening files via Browsers Directly) :
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.