2000-02-04 08:45:35 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2002-11-24 01:24:04 +01:00
|
|
|
MOZILLA_DIR="%%PREFIX%%/lib/%%MOZILLA%%"
|
2004-12-24 19:25:45 +01:00
|
|
|
MOZILLA_EXEC="./mozilla"
|
|
|
|
MOZILLA_REMOTE_EXEC="${MOZILLA_EXEC} -remote"
|
|
|
|
APPLICATION_ID="mozilla"
|
|
|
|
|
2002-11-24 01:24:04 +01:00
|
|
|
LOCATION='new-tab'
|
2004-12-24 19:25:45 +01:00
|
|
|
#MOZILLA_UILOCALE="en-US"
|
|
|
|
#MOZILLA_UIREGION="US"
|
|
|
|
#MOZILLA_DSP="auto"
|
2002-11-24 01:24:04 +01:00
|
|
|
|
|
|
|
cd $MOZILLA_DIR || exit 1
|
|
|
|
|
2004-12-24 19:25:45 +01:00
|
|
|
# LANG, MOZILLA_UILOCALE, MOZILLA_UIREGION
|
|
|
|
if [ -n "$LANG" -a ! -n "${MOZILLA_UILOCALE}" ]; then
|
|
|
|
_locale="${LANG%%.*}"
|
|
|
|
if [ "${_locale}" != "en_US" -a "${_locale}" != "C" ]; then
|
|
|
|
_region="${_locale##*_}"
|
|
|
|
_locale="${_locale%_*}"
|
|
|
|
[ -r chrome/${_locale}-${_region}.jar ] && \
|
|
|
|
MOZILLA_EXEC="${MOZILLA_EXEC} -UILocale ${_locale}-${_region}"
|
|
|
|
fi
|
|
|
|
elif [ -n "${MOZILLA_UILOCALE}" ]; then
|
|
|
|
MOZILLA_EXEC="${MOZILLA_EXEC} -UILocale ${MOZILLA_UILOCALE}"
|
|
|
|
if [ -n "${MOZILLA_UIREGION}" ]; then
|
|
|
|
MOZILLA_EXEC="${MOZILLA_EXEC} -UIRegion ${MOZILLA_UIREGION}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# find a /dev/dsp handler
|
|
|
|
case "${MOZILLA_DSP}" in
|
|
|
|
# [Ee][Ss][Dd]|esddsp) # Use the esd dsp wrapper
|
|
|
|
# MOZILLA_DSP="esddsp"
|
|
|
|
# ;;
|
|
|
|
[Aa][Rr][Tt][Ss]|artsdsp) # Use the arts dsp wrapper
|
|
|
|
MOZILLA_DSP="artsdsp"
|
|
|
|
;;
|
|
|
|
[Nn][Oo][Nn][Ee]) # Direct dsp output
|
|
|
|
MOZILLA_DSP=""
|
|
|
|
;;
|
|
|
|
*) # Guest one (auto)
|
|
|
|
if [ -n "${KDE_FULL_SESSION}" ]; then
|
|
|
|
MOZILLA_DSP="artsdsp"
|
|
|
|
# elif [ -r ${HOME}/.esd_auth ]; then
|
|
|
|
# MOZILLA_DSP="esddsp"
|
|
|
|
else
|
|
|
|
MOZILLA_DSP=""
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ -n "${MOZILLA_DSP}" ] && type "${MOZILLA_DSP}" > /dev/null 2>&1; then
|
|
|
|
MOZILLA_EXEC="${MOZILLA_DSP} ${MOZILLA_EXEC}"
|
|
|
|
fi
|
|
|
|
|
2002-11-27 23:48:54 +01:00
|
|
|
case $1 in
|
2003-08-12 18:48:56 +02:00
|
|
|
-browser)
|
|
|
|
REMOTE_COMMAND="xfeDoCommand (openBrowser)"
|
|
|
|
;;
|
2002-11-27 23:48:54 +01:00
|
|
|
-mail)
|
|
|
|
REMOTE_COMMAND="xfeDoCommand (openInbox)"
|
|
|
|
;;
|
2003-08-12 18:48:56 +02:00
|
|
|
-compose)
|
|
|
|
REMOTE_COMMAND="xfeDoCommand (composeMessage)"
|
|
|
|
;;
|
2002-11-27 23:48:54 +01:00
|
|
|
-*)
|
2004-12-24 19:25:45 +01:00
|
|
|
exec ${MOZILLA_EXEC} "$@"
|
2002-11-27 23:48:54 +01:00
|
|
|
;;
|
|
|
|
*)
|
2004-12-24 19:25:45 +01:00
|
|
|
if [ -n "${LOCATION}" ]; then
|
|
|
|
REMOTE_COMMAND="openURL($@,$LOCATION)"
|
|
|
|
else
|
|
|
|
REMOTE_COMMAND="openURL($@)"
|
|
|
|
fi
|
2002-11-27 23:48:54 +01:00
|
|
|
;;
|
|
|
|
esac
|
2004-12-24 19:25:45 +01:00
|
|
|
|
2002-11-24 01:24:04 +01:00
|
|
|
# process found
|
2004-12-24 19:25:45 +01:00
|
|
|
${MOZILLA_REMOTE_EXEC} "ping()" >/dev/null 2>&1 &&
|
|
|
|
${MOZILLA_REMOTE_EXEC} "${REMOTE_COMMAND}" && exit 0
|
2002-11-24 01:24:04 +01:00
|
|
|
|
|
|
|
# no existing process
|
2004-12-24 19:25:45 +01:00
|
|
|
exec ${MOZILLA_EXEC} "$@"
|
2002-11-24 01:24:04 +01:00
|
|
|
|