#---
## @Synopsis libdesktop
#---

query_spell_desktop_file() {
if query "Will you be adding a custom desktop file:" "n"
then
  BUILD_DTFILE="desktop/${SPELL_NAME}.desktop, "
  DTFILE_MENUENTRY="${SPELL_NAME}"

  query_msg "Please enter the name of the executable:"
  read "DTFILE_EXEC"

  query_msg "Please enter the menupath separated and closed by ';'"
  message "example: Applications;Editors;foobar;"
  read "DTFILE_MENUPATH"

  query_msg "Please enter the name of the icon, if it has one:"
  read "DTFILE_ICON"

  query "Does this app need to be started in an xterm?" "n" && DTFILE_TERM="True"
fi
}

add_desktop_file() {
  mkdir -p desktop
  cd desktop
  echo "[Desktop Entry]" >> ${SPELL_NAME}.desktop
  echo "Encoding=UTF-8" >> ${SPELL_NAME}.desktop
  echo "Version=${SPELL_VERSION}" >> ${SPELL_NAME}.desktop
  echo "Name=${DTFILE_MENUENTRY}" >> ${SPELL_NAME}.desktop
  echo "Type=Application" >> ${SPELL_NAME}.desktop
  echo "Comment=${SPELL_SHORT_DESCRIPTION}" >> ${SPELL_NAME}.desktop
  echo "Exec=${DTFILE_EXEC}" >> ${SPELL_NAME}.desktop
  echo "Icon=${DTFILE_ICON}" >> ${SPELL_NAME}.desktop
  echo "Categories=${DTFILE_MENUPATH}" >> ${SPELL_NAME}.desktop
  echo "Term=${DTFILE_TERM}" >> ${SPELL_NAME}.desktop
  cd ..
}
#---
##
## This software is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This software is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this software; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
##
#---

