From 5495bd1ba855ae5398b03c16ae9d5af0c1b9e317 Mon Sep 17 00:00:00 2001 From: filux Date: Sun, 24 May 2015 17:13:35 +0200 Subject: [PATCH] added new script which helps to improve .desktop files' configuration for standalone linux's client --- .../megaglest-configure-desktop.sh | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 mk/linux/tools-for-standalone-client/megaglest-configure-desktop.sh diff --git a/mk/linux/tools-for-standalone-client/megaglest-configure-desktop.sh b/mk/linux/tools-for-standalone-client/megaglest-configure-desktop.sh new file mode 100755 index 00000000..14578fb1 --- /dev/null +++ b/mk/linux/tools-for-standalone-client/megaglest-configure-desktop.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# Use this script to improve configuration of '.desktop' files. +# ---------------------------------------------------------------------------- +# 2014 Written by filux +# Copyright (c) 2014-2015 under GNU GPL v3.0+ +LANG=C + +CURRENTDIR="$(dirname "$(readlink -f "$0")")" +cd "$CURRENTDIR"; prmtr="Icon="; prmtr2="Exec=" +if [ -f "megaglest.desktop" ] && [ -f "megaglest.png" ] && [ -f "megaglest" ] \ + && [ -f "start_megaglest" ] && [ ! -f "glest-dev.ini" ]; then + desktop_location="$CURRENTDIR/megaglest.desktop"; icon_location="$CURRENTDIR/megaglest.png" + exec_location="$CURRENTDIR/start_megaglest" + sed -i -e "s#$prmtr.*#$prmtr$icon_location#" -e "s#$prmtr2.*#$prmtr2$exec_location#" \ + "$desktop_location" + chmod +x $desktop_location +fi +if [ -f "megaglest_editor.desktop" ] && [ -f "megaglest.png" ] && [ -f "megaglest_editor" ] \ + && [ -f "start_megaglest_mapeditor" ] && [ ! -f "glest-dev.ini" ]; then + desktop_location="$CURRENTDIR/megaglest_editor.desktop" + icon_location="$CURRENTDIR/megaglest.png"; exec_location="$CURRENTDIR/start_megaglest_mapeditor" + sed -i -e "s#$prmtr.*#$prmtr$icon_location#" -e "s#$prmtr2.*#$prmtr2$exec_location#" \ + "$desktop_location" + chmod +x $desktop_location +fi +if [ -f "megaglest_g3dviewer.desktop" ] && [ -f "megaglest.png" ] && [ -f "megaglest_g3dviewer" ] \ + && [ -f "start_megaglest_g3dviewer" ] && [ ! -f "glest-dev.ini" ]; then + desktop_location="$CURRENTDIR/megaglest_g3dviewer.desktop" + icon_location="$CURRENTDIR/megaglest.png"; exec_location="$CURRENTDIR/start_megaglest_g3dviewer" + sed -i -e "s#$prmtr.*#$prmtr$icon_location#" -e "s#$prmtr2.*#$prmtr2$exec_location#" \ + "$desktop_location" + chmod +x $desktop_location +fi