#!/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)
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/background/picture_filename /usr/share/backgrounds/Fresh.jpg
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/background/picture_options "zoom"
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/interface/gtk_theme Shiki-Wise
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/interface/icon_theme gnome-wise
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/metacity/general/theme Shiki-Colors-Metacity
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/sound/theme_name LinuxMint
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/notification-daemon/theme standard
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/gnome-session/options/splash_image splash/linuxmint.png
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type  string --set /desktop/gnome/background/primary_color "#000000000000"
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/background/secondary_color "#000000000000"
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/background/color_shading_type "solid"
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/compiz/plugins/cube/screen0/options/color "#eeeeee00"
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type int --set /apps/metacity/general/num_workspaces 4
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type int --set /apps/compiz/general/screen0/options/hsize 4
	gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/compiz/plugins/cube/screen0/options/color 000000ff
	sudo -u gdm gconftool-2 --set --type string --set /desktop/gnome/background/picture_filename /usr/share/backgrounds/Fresh.jpg
	sudo -u gdm gconftool-2 --set --type string --set /desktop/gnome/interface/gtk_theme Shiki-Wise
	sudo -u gdm gconftool-2 --set --type string --set /desktop/gnome/interface/icon_theme gnome-wise		
	if [ -L /boot/gfxmenu/default.message ]; then
		rm -rf /boot/gfxmenu/default.message
		ln -s /boot/gfxmenu/linuxmint.message /boot/gfxmenu/default.message
	fi
	if [ ! -f /boot/gfxmenu/xfce.message ]; then
		ln -s /boot/gfxmenu/linuxmint.message /boot/gfxmenu/xfce.message
	fi
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
    ;;

    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


