#!/bin/sh
# postinst script 
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#

case "$1" in    
    configure|upgrade|update|reconfigure)	
	if [ ! -d /usr/share/backgrounds ]; then
		cd /usr/share/
		ln -s ../share/xfce4/backdrops /usr/share/backgrounds   
	fi
	if [ -L /usr/share/backgrounds ]; then
		rm -f -R /usr/share/backgrounds
		cd /usr/share/
		ln -s ../share/xfce4/backdrops /usr/share/backgrounds   	
	else
		mv -f /usr/share/backgrounds/* /usr/share/xfce4/backdrops/
		rm -f -R /usr/share/backgrounds
		cd /usr/share/
		ln -s ../share/xfce4/backdrops /usr/share/backgrounds   
	fi

	glib-compile-schemas /usr/share/glib-2.0/schemas

	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/gnome-terminal/profiles/Default/use_theme_colors false
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/gnome-terminal/profiles/Default/background_color "#2E2E34343636"
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/gnome-terminal/profiles/Default/foreground_color "#FFFFFFFFFFFF"

    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


