Quote:
Originally Posted by shadowsnipes
You should also check if xine has a setting to make sure only one instance is opened. I don't use xine, so I don't know if it has this.
|
I'm definitely no xine expert, but a quick look through the settings menu (with "Configuration experience level" set to "Master of the known universe"...seriously.
) didn't find much.
Quote:
Originally Posted by shadowsnipes
Finally, you may be able to use something like wmctrl in a script to make sure that only one instance of xine is used (ie. you keep reusing the one instance). Here is a link with an example of this.
|
That is nifty, but I don't think it'll accomplish the correct result. That checks to see if xine is running, and if it is, it just switches to the desktop running xine. Although very nifty, it won't actually close xine and open another instance with the desired video (I'm assuming the videos are being launched from an external application like Konqueror or Dolphin or something) -- it'll just display the already-running instance of xine, requiring you to go open the video from xine's menu instead of switching to the desired video. A better solution, I think, would be to create a file association that runs a script that kills any xine instances and then launches the video with xine. You could create a script like the following:
Code:
#!/bin/sh
pkill xine
xine $1
If you're using KDE, you can set file associations in "Control Center">"KDE Components">"File Associations". Look for all of the video formats you want to use and add an application (navigate to your script using the browse dialog). Make sure your script is executable (run `chmod +x scriptname.sh`). I tested the above little script and it does the job. It will of course work with any DE/WM as long as you can set the file associations. This is all assuming that you are launching the videos from an external application. Opening a new video in xine after watching another one seems to work fine without opening another instance.