I have installed DivX Player (version 6.6) using Wine in my ubuntu 11.10. Is there any way to make it a default player to play certain video formats ?
Thanks in advance.
I have installed DivX Player (version 6.6) using Wine in my ubuntu 11.10. Is there any way to make it a default player to play certain video formats ?
Thanks in advance.
It is possible, though it is potentially a bit more complicated.
If DivX shows up as an option in the "Open With" list for your files, then you can easily set it as default.
If it does not, then I would suggest not bothering to go through the trouble.
A long post, but the first and last bits, may be enough for you.
You can put a launching command into a script (eg
divx-player
) and assign that script to launch a particular type via Nautilus - Properties - Open with...But what is the command? The following explanation is long, but the idea is very simple, once you've "got" it ..(it took me quite a while to "get" it :)
Because you can have multiple
wine
environments installed (eg, to suit specific settings for a particular program), the system must be told whichwine
you want to run.. For this,wine
relies on an environment variable named $WINEPREFIX.If you are using
wine
from its default location, $WINEPREFIX will have a value of$HOME/.wine
... Let's assume that your DivX player is installed to this WINEPREFIX (to this environment)...To be robust, your
wine
command should explicitly specify the WINEPREFIX, sowine
knows which wine environment to run in.If you don't explicitly specify the WINEPREFIX, wine will use the default value you specified when you installed wine.
Here is the command to specify the WINEPREFIX you want to use.
To cleanly launch an app via a Windows command-line, it is a good idea to use the Windows
start.exe
command, so the command nees to include this (note the use of thw Windows C:\style\path-name here)..Files that reside within the
$WINEPREFIX/dosdevices/c:/
directory can be addressed in this Windows style, but files elsewhere on your sysem, need a different approach.Windows
C:\
is mapped to the unix directory`$WINEPREFIX/dosdevices/c:/
, and likewise other files on your system can be accessed from withinwine
via another virtual Windows disk-driveZ:\
... butwine
provides a simpler method to access your data files (eg, a movie, somewhere/anywhere on your file-system).These files are, of course, known in the Unix/Linux world by their Unix-style path-names.
wine
facilitates the translation from unix-style path-names to windows-style path-names via a wine-specific command-line option/Unix
Your DivX player command now needs to be followed by the
/path/to/the/DivX-player
-options
/path/to/the/movie
. But because the DivX player is a Windows app, it expects all paths to be in Windows format (ie:C:\Program Files\etc\etc
).As the DivX player.exe is within the
WINEPREFX
environment you can launch it either via itsC:\Windows\path
or via/Unix /Unix/path
. Using the/Unix
option is typically easier and less error-prone, because you don't have to manually flip all the slashes to back-slashes. All four of the following command will run the player, but the first one (/Unix /unix-path/player.exe
) is typically the best choice.Then you can just tack on the final arg, the movie-path, (in unix-style)... so the full command becomes...
Nautilus will automatically provide the movie path, so your command for your
divx-player
bash script needs to cater of an argument, as follows