diff --git a/install.sh b/install.sh index 620a5878..a8216890 100755 --- a/install.sh +++ b/install.sh @@ -4,38 +4,100 @@ ac_version=1.1.0.5 ac_dir=$(dirname $(readlink -f "${0}")) ac_exec=assaultcube.sh +ac_menupath=~/.local/share/applications +ac_desktoppath=~/Desktop +ac_entryfile=assaultcube.desktop ac_desktop="undefined" -ac_existdesktopentry=" " -ac_existmenuentry=" " -ac_existprotocol=" " GetDesktop() { - case ${DESKTOP_SESSION} in - gnome) - ac_desktop="Gnome" - ;; - *) - ac_desktop="undefined" - ;; - esac + case ${DESKTOP_SESSION} in + gnome) + ac_desktop="Gnome" + ;; + *) + ac_desktop="undefined" + ;; + esac } existDesktopEntry() { + if [ -f ${ac_desktoppath}/${ac_entryfile} ]; then + ac_existdesktopentry="X" + else ac_existdesktopentry=" " + fi } existMenuEntry() { + if [ -f ${ac_menupath}/${ac_entryfile} ]; then + ac_existmenuentry="X" + else ac_existmenuentry=" " + fi } existProtocol() { - ac_existprotocol=" " + ac_existprotocol=" " +} +installDesktopEntry() +{ + mkdir -pv ${ac_desktoppath} + cat > ${ac_desktoppath}/${ac_entryfile} < ${ac_menupath}/${ac_entryfile} <