The 3d modeling program SketchUp allows to edit a texture image with an external editor. The texture is exported into the temp folder and then the image editor is executed with the image path as argument. I want to edit textures with the native (linux) Gimp. If I add in the preferences of SketchUp "/usr/bin/gimp", it succeeds to start gimp, but the file cannot be opened due to a wrong file path and slashes/backslashes: /usr/bin/C:\users\aerilius\Temp\texture1.jpg could not be opened. My idea was to add in SketchUp's preferences the path to a shell script which passes the corrected file path to Gimp: Code: #!/bin/sh PATHWIN="$*" PATHUNIX="~/.wine/dosdevices/${PATHWIN//\\//}" gimp "$PATHUNIX" exit 0 But SketchUp says "image editor could not be launched". Is there a mistake in the script (my first shell script), or is it not possible that way? Have there already been similar situations with other programs?
Depending on the app there are various ways to interact with native Linux apps. The FAQ has several examples (winepath is your friend): http://wiki.winehq.org/FAQ#head-e03d797155ac6e9d8176f045acbdeebc28ad33d4
On Tue, 2010-09-07 at 19:42 -0500, Aerilius wrote:> But SketchUp says "image editor could not be launched". Is there a > mistake in the script (my first shell script), or is it not possible > that way? Have there already been similar situations with other > programs? >Did you make the script executable? "chmod uga+x myscript" Is the script in a directory thats listed in the search path $PATH ? If not, the following makes a conventional place to keep your scripts and adds it to $PATH <code> cd ~ mkdir bin mv myscript ~/bin </code> and add the line "export PATH="$HOME/bin:$PATH" to the end of the ~/.bash_profile. Then logout and login. You should now see /home/myuser/bin as the first entry in $PATH. Use 'echo $PATH' to check and should be able to run the script. Try 'which myscript' to check that its now executable and in the path. Martin
Many thanks! I knew to make sure that the file is executable, but I $PATH was new to me. I tried it now with many different compinations (my own script, the run_linx_program from the wiki link above). I tried to leave the field empty in SketchUp's preferences and set jpg files to be opened with the run_linx_program script. I get always the error message "image editor could not be launched" (roughly translated) Only two possibilities worked: When I add simply winebrowser "%1" to the registry, I get the error message but the image opens in eye-of-gnome. When I add winebrowser in SketchUp's preferences, it opens eye-of-gnome and there is no error message. It seems that the error message appears only when I pass the image to a script, and the only possibility that I found is winebrowser. I would like to keep an image viewer default for jpg files on my linux desktop. Is it possible to make winebrowser open jpg files in gimp, or to make gimp only default for jpg within wine?