#!/bin/sh
# postinst script for #PACKAGE#

set -e

case "$1" in
    configure)
        ## dconf ##
        cp -af /usr/share/big-crime-kde-settings/etc/dconf          /etc
        ## gtk-2.0 ##
        cp -af /usr/share/big-crime-kde-settings/etc/gtk-2.0          /etc
        ## kde ##
        cp -af /usr/share/big-crime-kde-settings/etc/kde-user-profile /etc
        ## policyḱit-1 ##
        cp -af /usr/share/big-crime-kde-settings/etc/polkit-1         /etc
        ## skel ##
        cp -af /usr/share/big-crime-kde-settings/etc/skel/dmrc        /etc/skel/.dmrc
        cp -af /usr/share/big-crime-kde-settings/etc/skel/config      /etc/skel/.config
        cp -af /usr/share/big-crime-kde-settings/etc/skel/local       /etc/skel/.local
        ## usr ##
        #cp -af /usr/share/big-crime-kde-settings/usr/*                /usr
        ## xdg ##
        cp -af /usr/share/big-crime-kde-settings/etc/xdg              /etc
        ## settings ##
        dconf update
        if [ -e /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/config/main.xml ]; then
    	    sed -i 's/default>preferred.*/default>preferred:\/\/browser,org.kde.plasma-systemmonitor.desktop,org.kde.konsole.desktop,systemsettings.desktop,org.kde.dolphin.desktop,org.kde.discover.desktop<\/default>/' /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/config/main.xml
        fi
        if [ -e /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml ]; then
    	    sed -i 's/default>applic.*/default>applications:systemsettings.desktop,applications:org.kde.dolphin.desktop,applications:org.kde.konsole.desktop,applications:firefox.desktop<\/default>/' /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml
        fi
    ;;

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

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

#DEBHELPER#

exit 0
