I wrote a bash script (here) for extracting EXIF GPS coordinates from an image and displaying those coordinates as a pointer in Google Maps. It works perfectly when used like this in the terminal:
GUI=1 ./show_location_in_chrome.sh /path/to/image.jpg
I have added a right-click command to Nautilus using Nautilus-Actions with these settings:
Path: GUI=1 /home/tomas/show_location_in_chrome.sh Parameters: %f Basename filter: *.jpg
But when I right-click a JPEG file and click the menu item, nothing happens. The only exception is when the "Execution mode" is set to "Display output", in which case the script works as intended. Unfortunately Nautilus also displays a large window with script output that I have to manually close every time.
How do I figure out why the script doesn't work in any other execution mode than "Display output"? Please comment if I can provide any more specific information.
The "Run command" displayed in the command output is:
/bin/sh -c 'GUI=1 /home/tomas/show_location_in_chrome.sh '\''/home/tomas/Dropbox/Camera Up loads/2013-07-21 14.58.33.jpg'\'''
Edit: I have added
#!/usr/bin/env bash to the top of my script and removed the explicit call to
bash in the "Path" setting. It changed nothing.
Edit: I added
echo "Works" > ~/test.txt to the top of the script (below the shebang), then clicked the menu item. No files were added to my Home folder, so I have concluded that the script isn't even being executed when the execution mode is anything other than "Display output".