#!/bin/sh

if [ -n "$1" ]; then
	cd `dirname $1`

	# If we have gimp-remote, try to use the already-running copy
	if [ -x "`which gimp-remote`" ]; then
		exec gimp-remote -n "$@"
	fi
fi

exec gimp "$@"
