#!/bin/sh

if [ -r $HOME/.gnome2/session-manual -a ! -r $HOME/.gnome2/.mdkgalaxymigrate ]; then
  sed -i -e 's|0,RestartStyleHint=3\n0,Priority=50\n0,RestartCommand=/usr/bin/mandrakegalaxy\n||m' $HOME/.gnome2/session-manual 
touch $HOME/.gnome2/.mdkgalaxymigrate 
fi

if [ -f "$HOME/.menu/disable_mdk_customization" -o \( -f "/etc/menu/disable_mdk_customization" -a ! -f "$HOME/.menu/enable_mdk_customization" \) ]; then
	if  [ -z "$XDG_CONFIG_DIRS" ]; then
 	    export XDG_CONFIG_DIRS="/etc/xdg/gnome"
	else
	    export XDG_CONFIG_DIRS="/etc/xdg/gnome:$XDG_CONFIG_DIRS"
	fi
else
	if  [ -z "$XDG_CONFIG_DIRS" ]; then
 	    export XDG_CONFIG_DIRS="/etc/xdg/gnome"
	else
	    export XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:/etc/xdg/gnome"
	fi
fi


# path takes precedence
exec gnome-session
exec /usr/bin/gnome-session
