[Wine] Re: Passing arguments during OLE
neonjohn
wineforum-user at winehq.org
Sat Jan 24 19:08:36 CST 2009
[quote="vitamin"][quote="neonjohn"]I'm trying to get Irfanview (yes I know about the alleged clone. It isn't) to work as an "open with" program for .jpg files.[/quote]
You need to use winepath to translate *NIX paths into win paths: http://wiki.winehq.org/winepath[/quote]
Thanks for the tip. Now here's the solution. I had to write a shell script because apparently gnome won't execute a $() or back-tick command.
I called the script "iv" and put it in /usr/local/bin. Put the text between the dotted lines below in a file called iv (or whatever you like). Do a
$ sudo chmod +x /usr/local/bin/iv
------------------------------------------
#!/bin/bash
foo=$(winepath -w $*)
# uncomment these two lines to print diagnostics in x windows
#xmessage $* &
#xmessage $foo &
wine "/home/jgd/.wine/drive_c/Program Files/IrfanView/i_view32.exe" $foo
exit
--------------------------------------------
To associate this with a jpeg, right click on the jpg file, any file and select "propreties" When the window opens, select "Open With", click "add" and then select "use a custom command" In the command line type
/usr/local/bin/iv
Close all the windows and that's it.
the process is somewhat slow on this older 2 ghz laptop, taking about 4 seconds to open but that's OK. I would have preferred not to have to use a script but it works and that's what matters.
This script can also be used from the shell prompt to view any type of file Irfanview can open. Example
$ iv foo.jpg
$ iv /media/camera_card/dcim/foo.jpg
The latter is a typical command to view a file on a media card from a camera.
John
More information about the wine-users
mailing list