Page 1 of 1

Linux script for launching windows version from file-manager

Posted: Sun Aug 23, 2009 1:48 pm
by marsh
Images can be opened with windows version from a linux file manager.
Instructions:
1. Create file named "xnview.sh" in same directory as program, containing this information:

Code: Select all

#!/bin/bash
export target=`winepath -w "$1"`
cd ~/wine_drive_d/xnview
wine xnview.exe "$target"
2. Make sure script has permission to run.
3. Substitute your actual program's location for the one listed in sample.
4. Open file manager.
5. Right mouse button upon image.
6. Choose "Open with other application".
7. Browse and select xnview.sh.
8. Image should launch in either fullscreen or windowed view according to settings.

Further details:
The "~" character means your home directory. The "winepath" function makes paths readable between Windows and Linux. An image must be at a discoverable location as shown on the "Drive mappings" section of wine's configuration dialog.

Re: Linux script for launching windows version from file-manager

Posted: Sun Nov 15, 2009 10:41 am
by marsh
One for nconvert (convert to png):

Code: Select all

#!/bin/sh
export input=`winepath -w "$1"`
cd ~/wine_drive_d/nconvert
wine nconvert.exe -v -in -1 -out png -clevel 3 -o "$\%.png" "$input"

Re: Linux script for launching windows version from file-manager

Posted: Mon Nov 16, 2009 8:53 am
by marsh
And one for MP:

Code: Select all

#!/bin/sh
progdir=`dirname $0`
export windir=`winepath -w "$progdir"`
export target=`winepath -w "$1"`
wine $windir/xnview.exe "$target"

Re: Linux script for launching windows version from file-manager

Posted: Mon Nov 16, 2009 11:07 am
by oops66
Hello and thank you marsh for these scripts