#!/bin/sh

# There appears to be a minor bug in bonobo-activation that causes the
# Yelp help browser to fail if the DISPLAY environment variable is set
# to :0 rather than :0.0  Once this issue is fixed in bonobo, the
# following two lines should be removed.
DISPLAY=`echo "$DISPLAY" | sed -e's/\(:[^.]*\)$/\1\.0/'`
export DISPLAY

# compatiblity...
# this is enough for debian, at least if using mozilla, not mozilla-snapshot
unset MOZILLA_FIVE_HOME

# GTK 2.0 doesn't work with gdkxft. It has xft support built-in.
if echo $LD_PRELOAD | grep -q gdkxft; then
	unset LD_PRELOAD
fi

export LD_LIBRARY_PATH=/usr/lib/mozilla:$LD_LIBRARY_PATH

# Buggy flash plugin tries to link against gtk 1.2 as default. This should make
# it a lot faster.
export FLASH_GTK_LIBRARY=libgtk-x11-2.0.so.0

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