From 53cb968efcdcae554a2ce89eef474585d8ff9813 Mon Sep 17 00:00:00 2001 From: aerkefiende Date: Mon, 7 Mar 2011 21:27:55 +0000 Subject: [PATCH] Next steps: implementing the protocol handler and tweak the *.desktop files git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6118 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- install.sh | 244 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 153 insertions(+), 91 deletions(-) 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} <