]> git.pld-linux.org Git - packages/icedove.git/blame - icedove.sh
- taken from thunderbird 2.0.0.14 for iceweasel 2.0.0.14
[packages/icedove.git] / icedove.sh
CommitLineData
ceb3e54a 1#!/bin/sh
2# based on script by (c) vip at linux.pl, wolf at pld-linux.org
3
4LIBDIR="@LIBDIR@/icedove"
5
6MOZARGS=
7MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \
8 sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
9for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
10 eval MOZLANG="$(echo $MOZLANG | sed -e "s|_\([^.]*\).*|-\1|g")"
11
12 if [ -f $LIBDIR/chrome/$MOZLANG.jar ]; then
13 MOZARGS="-UILocale $MOZLANG"
14 break
15 fi
16done
17
18if [ -z "$MOZARGS" ]; then
19 # try harder
20 for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
21 eval MOZLANG="$(echo $MOZLANG | sed -e "s|_.*||g")"
22
23 LANGFILE=$(echo ${MOZILLA_FIVE_HOME}/chrome/${MOZLANG}*.jar \
24 | sed 's/\s.*//g' )
25 if [ -f "$LANGFILE" ]; then
26 MOZLANG=$(basename "$LANGFILE" | sed 's/\.jar//')
27 MOZARGS="-UILocale $MOZLANG"
28 break
29 fi
30 done
31fi
32
33if [ -n "$MOZARGS" ]; then
34 ICEDOVE="$LIBDIR/icedove $MOZARGS"
35else
36 ICEDOVE="$LIBDIR/icedove"
37fi
38
39if [ "$1" == "-remote" ]; then
40 $ICEDOVE "$@"
41else
42 PING=`$ICEDOVE -remote 'ping()' 2>&1 >/dev/null`
43 if [ -n "$PING" ]; then
44 $ICEDOVE "$@"
45 else
46 case "$1" in
47 -compose|-editor)
48 $ICEDOVE -remote 'xfeDoCommand (composeMessage)'
49 ;;
50 *)
51 $ICEDOVE -remote 'xfeDoCommand (openInbox)'
52 ;;
53 esac
54 fi
55fi
This page took 0.113262 seconds and 4 git commands to generate.