#!/bin/sh

if [ "$1" = "configure" ]; then
    echo "Enabling Monero GUI wallet in XDG Menu using 'desktop-file-install' ..."
    echo "    Menu metadata file located at: /usr/share/applications/monero.desktop"
    if desktop-file-install /usr/share/applications/monero.desktop; then
      echo " +++ Successfully enabled Monero GUI wallet in the system menu. "
      echo " +++ Monero should've been added to your system app menu, assuming it uses xdg-menu (e.g. GNOME, XFCE, and KDE)"
      echo " +++ You should be able to find Monero in your desktop environment's \"Application Menu\""
      echo " +++ If you can't see it, try logging out and back in again, or rebooting your OS."
    else
      echo " [!!!] ERR: Command 'desktop-file-install /usr/share/applications/monero.desktop' returned a non-zero return code."
      echo " [!!!] The 'Monero GUI Wallet' application itself may have installed just fine, however it may not be present in"
      echo " [!!!] your desktop environment's \"Application Menu\"."
    fi
    echo
    echo
    echo " [!!!] NOTE: Depending on your desktop environment, you may need to manually install the monero.desktop menu file"
    echo " [!!!] on each user account that you plan to use it on."
    echo " [!!!] To install/enable the Monero menu entry for a user account, simply run the following command as that user:"
    echo
    echo "           desktop-file-install /usr/share/applications/monero.desktop"
    echo
    echo
fi

