From ef4138701e28f8cecedc213fb4f6c7c69b35d060 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Fri, 19 Jun 2009 11:09:50 +0000 Subject: [PATCH] update desktop integration git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4526 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- client_desktop_install.sh | 35 ---------------------------------- install_desktop_menu.sh | 40 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 35 deletions(-) delete mode 100755 client_desktop_install.sh create mode 100755 install_desktop_menu.sh diff --git a/client_desktop_install.sh b/client_desktop_install.sh deleted file mode 100755 index 3e870cd3..00000000 --- a/client_desktop_install.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# announce the game to modern desktop environments -# (by creating ~/.local/share/applications/assaultcube_svn.desktop and ~/.local/share/icons/assaultcube.png) -# Hint: this script has to be located in the assaultcube base directory to work - -# get Exec target path (CUBE_DIR has to be the full path of the assaultcube base directory) -CUBE_DIR=$(dirname $(readlink -f "${0}")) - -if [ -x ${CUBE_DIR}/assaultcube.sh ] -then - cd ${CUBE_DIR} - mkdir -pv ~/.local/share/applications - mkdir -pv ~/.local/share/icons - cat > ~/.local/share/applications/assaultcube_svn.desktop << EOF_DESKTOPFILE -[Desktop Entry] -Version=1.0 -Encoding=UTF-8 -Name=AssaultCube SVN Test Version -Type=Application -GenericName=First Person Shooter -Icon=assaultcube.png -StartupNotify=false -Categories=Game;ActionGame; -Comment=Fast paced first-person shooter based upon the Cube engine -Comment[pl]=Szybka strzelanka oparta na silniku gry Cube -Comment[de]=Schneller Ego-Shooter basierend auf der Cube-Engine -EOF_DESKTOPFILE - echo "Exec=${CUBE_DIR}/assaultcube.sh" >> ~/.local/share/applications/assaultcube_svn.desktop - cp ${CUBE_DIR}/docs/pics/assaultcube.png ~/.local/share/icons -else - echo "could not find the AssaultCube base directory" - echo "move this script to the AC base directory and start it again" - exit 1 -fi - diff --git a/install_desktop_menu.sh b/install_desktop_menu.sh new file mode 100755 index 00000000..3ea6bed0 --- /dev/null +++ b/install_desktop_menu.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# announce the game to modern desktop environments +# (by creating ~/.local/share/applications/assaultcube.desktop) +# Hint: this script has to be located in the assaultcube base directory to work + +# get Exec target path (CUBE_DIR has to be the full path of the assaultcube base directory) + +CUBE_DIR=$(dirname $(readlink -f "${0}")) +CUBE_EXEC=assaultcube.sh +SHORTCUTPATH=~/.local/share/applications +SHORTCUTFILE=assaultcube_svn.desktop + +if [ -x "${CUBE_DIR}/${CUBE_EXEC}" ]; then + if [ -f ${SHORTCUTPATH}/${SHORTCUTFILE} ]; then + rm ${SHORTCUTPATH}/${SHORTCUTFILE} + echo "Shortcut removed." + else + mkdir -pv ${SHORTCUTPATH} + cat > ${SHORTCUTPATH}/${SHORTCUTFILE} <