Linux script for launching windows version from file-manager

Plug-ins, add-ons, skins, icons, templates and other downloads. Contributions are welcome.

Moderators: XnTriq, helmut, xnview

marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Linux script for launching windows version from file-manager

Post 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.
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

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

Post 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"
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

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

Post 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"
Last edited by marsh on Wed Nov 18, 2009 7:32 am, edited 4 times in total.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

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

Post by oops66 »

Hello and thank you marsh for these scripts
XnViewMP Linux X64 - Debian - X64