#!/bin/sh

if [ ! -d $KDEDIR/share/apps/kicker ]; then
  echo -e "\E[1;31mKDE not installed...\E[0m\n"
  exit 1
fi

if [ -f $KDEDIR/share/apps/kicker/pics/kside.png ]; then
  mkdir -p $KDEDIR/share/apps/kmsbii-slackware/backup

  echo -e "\nCreating backup for kside files..."
  cp $KDEDIR/share/apps/kicker/pics/kside* $KDEDIR/share/apps/kmsbii-slackware/backup
  rm $KDEDIR/share/apps/kicker/pics/kside*

  echo -e "Replacing kicker images files..."
  cp $KDEDIR/share/apps/kmsbii-slackware/kside* $KDEDIR/share/apps/kicker/pics
  chown root.root $KDEDIR/share/apps/kicker/pics/kside*
  chmod 644 $KDEDIR/share/apps/kicker/pics/kside*

  echo -e "kmsbii-slackware was installed...\n"
  echo -e "\E[1;32mNow, restart your kde-session for changes to take effect...\E[0m\n"

  echo -e "If you had to remove the package, it restore the image default doing:\n"
  echo -e "  cp $KDEDIR/share/apps/kmsbii-slackware/backup/* $KDEDIR/share/apps/kicker/pics\n"
fi
