#!/bin/sh
# postinst script for applet-touchcruiser
#
# 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>
#        * <postinst> `abort-remove'
#        * <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)
        TASK=`ps ax | grep /usr/bin/touchcruiser-indicator | grep -v grep`
set -e
        if [ -z "${TASK}" ]; then
            /usr/bin/touchcruiser-indicator >/dev/null &
        fi

        mv /usr/share/pixmaps/scrollmode32.png /usr/share/pixmaps/scrollmode.png
        mv /usr/share/icons/hicolor/16x16/apps/cursormode16.png /usr/share/icons/hicolor/16x16/apps/cursormode.png
        mv /usr/share/icons/hicolor/16x16/apps/scrollmode16.png /usr/share/icons/hicolor/16x16/apps/scrollmode.png
        mv /usr/share/icons/hicolor/32x32/apps/cursormode32.png /usr/share/icons/hicolor/32x32/apps/cursormode.png
        mv /usr/share/icons/hicolor/32x32/apps/scrollmode32.png /usr/share/icons/hicolor/32x32/apps/scrollmode.png
        mv /usr/share/icons/hicolor/48x48/apps/cursormode48.png /usr/share/icons/hicolor/48x48/apps/cursormode.png
        mv /usr/share/icons/hicolor/48x48/apps/scrollmode48.png /usr/share/icons/hicolor/48x48/apps/scrollmode.png

    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
set -e
    ;;

    *)
set -e
        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.
GCONF_CONFIG_SOURCE=xml:readwrite:/etc/gconf/gconf.xml.defaults gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/touchcruiser-indicator.schemas

#DEBHELPER#

exit 0
