summaryrefslogtreecommitdiff
path: root/indra/newview/linux_tools/register_secondlifeprotocol.sh
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/linux_tools/register_secondlifeprotocol.sh')
-rwxr-xr-xindra/newview/linux_tools/register_secondlifeprotocol.sh26
1 files changed, 14 insertions, 12 deletions
diff --git a/indra/newview/linux_tools/register_secondlifeprotocol.sh b/indra/newview/linux_tools/register_secondlifeprotocol.sh
index 4ab96f97d6..16e73cb854 100755
--- a/indra/newview/linux_tools/register_secondlifeprotocol.sh
+++ b/indra/newview/linux_tools/register_secondlifeprotocol.sh
@@ -7,10 +7,10 @@
HANDLER="$1"
RUN_PATH=`dirname "$0" || echo .`
-cd "${RUN_PATH}"
+cd "${RUN_PATH}/.."
if [ -z "$HANDLER" ]; then
- HANDLER=`pwd`/handle_secondlifeprotocol.sh
+ HANDLER=`pwd`/etc/handle_secondlifeprotocol.sh
fi
# Register handler for GNOME-aware apps
@@ -22,13 +22,12 @@ else
fi
# Register handler for KDE-aware apps
-if [ -z "$KDEHOME" ]; then
- KDEHOME=~/.kde
-fi
-LLKDEPROTDIR=${KDEHOME}/share/services
-if [ -d "$LLKDEPROTDIR" ]; then
- LLKDEPROTFILE=${LLKDEPROTDIR}/secondlife.protocol
- cat > ${LLKDEPROTFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTFILE}
+for LLKDECONFIG in kde-config kde4-config; do
+ if [ `which $LLKDECONFIG` ]; then
+ LLKDEPROTODIR=`$LLKDECONFIG --path services | cut -d ':' -f 1`
+ if [ -d "$LLKDEPROTODIR" ]; then
+ LLKDEPROTOFILE=${LLKDEPROTODIR}/secondlife.protocol
+ cat > ${LLKDEPROTOFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTOFILE}
[Protocol]
exec=${HANDLER} '%u'
protocol=secondlife
@@ -41,6 +40,9 @@ writing=false
makedir=false
deleting=false
EOF
-else
- echo Warning: Did not register secondlife:// handler with KDE: Directory $LLKDEPROTDIR does not exist.
-fi
+ else
+ echo Warning: Did not register secondlife:// handler with KDE: Directory $LLKDEPROTODIR does not exist.
+ fi
+ fi
+done
+