#!/bin/sh
# If you start galeon with DISPLAY=:0 and then start it again with
# DISPLAY=:0.0 then new galeon instance doesn't find the other one,
# even though :0 and :0.0 refer to the same DISPLAY.
DISPLAY=`echo "$DISPLAY" | sed -e's/\(:[^.]*\)\.0$/\1/'`
export DISPLAY

# gconf2 is fixed, clean up compatibility schemas.
if [ -e ~/.galeon/gconf_schema_version ]; then
	rm -rf ~/.gconf/schemas/apps/galeon || true
	# gconftool --shutdown is ok, because this is supposed to be run only
	# once, and it will be restarted again by galeon.
	gconftool --shutdown || true
	rm -f ~/.galeon/gconf_schema_version || true
fi

# compatiblity...
unset MOZILLA_FIVE_HOME

# time to launch the browser...
exec /usr/bin/galeon-bin "$@"

