#!/bin/sh # /usr/bin/winenative # # License: GPL >= V3 # Author: A. Tres Finocchiaro # Modified: May 2008 Hilary BH Wright # # Used to call on the native linux OS to launch a filetype in Wine. # For example, if you have a Microsoft Word document, but want to # use the Linux version of OpenOffice Writer to open it, simply call: # @="/usr/bin/winenative "%1"" # in # HKEY_CLASSES_ROOT\linuxnative\shell\open\command # # This assumes you've already added: # @="linuxnative" # to # HKEY_CLASSES_ROOT\.doc --> "Content Type" # # The native command to open the file. This can be changed to $1, $2 # if you'd like to set up input variables, or you can type "openoffice" # or something similar if you'd like to statically map it. # # If you don't use gnome, change it to your desktop's equivelant, and # update this comment! cmd_open="gnome-open"; # The url of the file. Change to $2, etc if you want to take the 2nd # input variable in your call. win_file=$1; # Transform the windows path to the linux path with the 'winpath' command # (i.e. C:\Windows\Temp\1.doc to /home/tfino/.wine/drive_c/etc) # NOTE1: The ticks are (` = tilde key) NOT (' = quote key). # NOTE2: You need the "" here in order to allow for spaces in the path and file names. # NOTE3: the -u parameter is there just to be sure that you are chnaging from windows paths to linux paths: it is the default. lin_file=`winepath -u "$win_file"`; # Call the native command passing the linux path enclosed in "" $cmd_open "$lin_file"; # Exit status 1? Manipulate this value to work with errors. exit 1;