summaryrefslogtreecommitdiff
path: root/indra/newview/linux_tools
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/linux_tools')
-rwxr-xr-xindra/newview/linux_tools/handle_secondlifeprotocol.sh17
-rwxr-xr-xindra/newview/linux_tools/register_secondlifeprotocol.sh46
-rwxr-xr-xindra/newview/linux_tools/wrapper.sh4
3 files changed, 67 insertions, 0 deletions
diff --git a/indra/newview/linux_tools/handle_secondlifeprotocol.sh b/indra/newview/linux_tools/handle_secondlifeprotocol.sh
new file mode 100755
index 0000000000..7ff86d1b93
--- /dev/null
+++ b/indra/newview/linux_tools/handle_secondlifeprotocol.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Send a URL of the form secondlife://... to Second Life.
+#
+
+URL="$1"
+
+if [ -z "$URL" ]; then
+ echo Usage: $0 secondlife://...
+ exit
+fi
+
+RUN_PATH=`dirname "$0" || echo .`
+cd "${RUN_PATH}"
+
+exec ./secondlife -url \'"${URL}"\'
+
diff --git a/indra/newview/linux_tools/register_secondlifeprotocol.sh b/indra/newview/linux_tools/register_secondlifeprotocol.sh
new file mode 100755
index 0000000000..4ab96f97d6
--- /dev/null
+++ b/indra/newview/linux_tools/register_secondlifeprotocol.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# Register a protocol handler (default: handle_secondlifeprotocol.sh) for
+# URLs of the form secondlife://...
+#
+
+HANDLER="$1"
+
+RUN_PATH=`dirname "$0" || echo .`
+cd "${RUN_PATH}"
+
+if [ -z "$HANDLER" ]; then
+ HANDLER=`pwd`/handle_secondlifeprotocol.sh
+fi
+
+# Register handler for GNOME-aware apps
+LLGCONFTOOL2=gconftool-2
+if which ${LLGCONFTOOL2} >/dev/null; then
+ (${LLGCONFTOOL2} -s -t string /desktop/gnome/url-handlers/secondlife/command "${HANDLER} \"%s\"" && ${LLGCONFTOOL2} -s -t bool /desktop/gnome/url-handlers/secondlife/enabled true) || echo Warning: Did not register secondlife:// handler with GNOME: ${LLGCONFTOOL2} failed.
+else
+ echo Warning: Did not register secondlife:// handler with GNOME: ${LLGCONFTOOL2} not found.
+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}
+[Protocol]
+exec=${HANDLER} '%u'
+protocol=secondlife
+input=none
+output=none
+helper=true
+listing=
+reading=false
+writing=false
+makedir=false
+deleting=false
+EOF
+else
+ echo Warning: Did not register secondlife:// handler with KDE: Directory $LLKDEPROTDIR does not exist.
+fi
diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh
index 10041ee255..638a0f0b76 100755
--- a/indra/newview/linux_tools/wrapper.sh
+++ b/indra/newview/linux_tools/wrapper.sh
@@ -61,6 +61,10 @@ fi
RUN_PATH=`dirname "$0" || echo .`
cd "${RUN_PATH}"
+
+# Re-register the secondlife:// protocol handler every launch, for now.
+./register_secondlifeprotocol.sh
+
if [ -n "$LL_TCMALLOC" ]; then
tcmalloc_libs='/usr/lib/libtcmalloc.so.0 /usr/lib/libstacktrace.so.0 /lib/libpthread.so.0'
all=1