#!/bin/sh

#remove 66force-conf
if [ -f /etc/apt/apt.conf.d/66force-conf ]; then
    rm /etc/apt/apt.conf.d/66force-conf
fi

ln -sf /opt/branding/Toshiba/ /usr/share/doc/TOSHIBA
ln -sf /opt/branding/Toshiba/ /usr/local/share/TOSHIBA

# Add entry for custom firefox preferences for ubufox firefox theme
# only do on initial install
if [ "configure" = "$1" ] && [ -z "$2" ]; then 
    printf "\npref(\"browser.startup.homepage\", \"file:/opt/branding/Toshiba/firefox/prefrences/toshiba-homepage.properites\");\n\n" >> /etc/firefox-3.0/pref/ubufox.js
    printf "\npref(\"browser.search.defaultenginename\", \"Google\");\n\n" >> /etc/firefox-3.0/pref/ubufox.js
fi


# workaround for LP 284793
# only do on initial install
if [ "configure" = "$1" ] && [ -z "$2" ]; then 
cat > /etc/rc.local << EOF
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


# Crude fix for getting gdm to start after hal
if [ -f /etc/event.d/gdm ]; then
	update-upstart disable gdm
	update-rc.d -f gdm remove
	update-rc.d gdm start 30 2 3 4 5 . stop 01 0 1 6 .
fi

exit 0

EOF
chmod 755 /etc/rc.local
fi

if [ "$1" = "configure" ] && which update-gconf-defaults >/dev/null 2>&1; then
        update-gconf-defaults
fi


#workaround for LP#284294
mv -f /usr/share/applications/gnome-screenshot.desktop /usr/share/applications/gnome-screenshot.desktop.old
sed 's/Exec\=gnome-screenshot --interactive/Exec\=gnome-screenshot --interactive --delay 1/' /usr/share/applications/gnome-screenshot.desktop.old  > /usr/share/applications/gnome-screenshot.desktop
chmod 644 /usr/share/applications/gnome-screenshot.desktop
rm -f usr/share/applications/gnome-screenshot.desktop.old
dpkg-divert --package toshiba-config --add /usr/share/applications/gnome-screenshot.desktop

#DEBHELPER#

