#!/bin/sh -e
# Elimina los archivos que se agregaron por fuera del instalador
if [ "$1" = "purge" ] ; then
    if [ -d "/usr/share/miescritorio/" ]; then
	    rm -R /usr/share/miescritorio/
    fi
fi

if [ "$1" = "remove" ];
then
   # Add an entry to the system menu
   XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
   UPDATE_MENUS="`which update-menus 2> /dev/null`"
   if [ ! -x "$XDG_DESKTOP_MENU" ]; then
     echo "Error: Could not find xdg-desktop-menu" >&2
     #exit 1
   fi
   if [ -f /usr/share/applications/educar-miescritorio.desktop ];
   then
       "$XDG_DESKTOP_MENU" uninstall /usr/share/applications/educar-miescritorio.desktop
   fi

   # Add icons to the system icons
   XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
   if [ ! -x "$XDG_ICON_RESOURCE" ]; then
     echo "Error: Could not find xdg-icon-resource" >&2
     #exit 1
   fi
   if [ -f /usr/share/miescritorio/aplicacion/desktop.png ];
   then
       "$XDG_ICON_RESOURCE" uninstall --size 48 /usr/share/miescritorio/aplicacion/desktop.png "educar-miescritorio"
   fi
fi

#DEBHELPER#
