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

Postby marsh » Sun Aug 23, 2009 1:48 pm

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

Postby marsh » Sun Nov 15, 2009 10:41 am

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

Postby marsh » Mon Nov 16, 2009 8:53 am

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: 1998
Joined: Tue Jul 17, 2007 1:17 am
Location: France

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

Postby oops66 » Mon Nov 16, 2009 11:07 am

Hello and thank you marsh for these scripts
XnViewMP 0.82 Linux X64 - Ubuntu 16.04 LTS - X64


Return to “Customization”

Who is online

Users browsing this forum: No registered users and 2 guests