]>
Commit | Line | Data |
---|---|---|
ceb3e54a | 1 | #!/bin/sh |
2 | # based on script by (c) vip at linux.pl, wolf at pld-linux.org | |
3 | ||
4 | LIBDIR="@LIBDIR@/icedove" | |
5 | ||
e98019c8 | 6 | # copy profile from Thunderbird if its available and if no Icedove |
7 | # profile exists | |
8 | if [ ! -d $HOME/.icedove ]; then | |
9 | if [ -d $HOME/.thunderbird ]; then | |
10 | echo "Copying profile from Thunderbird" | |
11 | cp -rf $HOME/.thunderbird $HOME/.icedove | |
12 | fi | |
13 | fi | |
14 | ||
13040066 | 15 | MOZARGS= |
16 | MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \ | |
17 | sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )" | |
18 | for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do | |
19 | eval MOZLANG="$(echo $MOZLANG | sed -e "s|_\([^.]*\).*|-\1|g")" | |
20 | ||
21 | if [ -f $LIBDIR/chrome/$MOZLANG.jar ]; then | |
22 | MOZARGS="-UILocale $MOZLANG" | |
23 | break | |
24 | fi | |
25 | done | |
26 | ||
27 | if [ -z "$MOZARGS" ]; then | |
28 | # try harder | |
29 | for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do | |
30 | eval MOZLANG="$(echo $MOZLANG | sed -e "s|_.*||g")" | |
31 | ||
32 | LANGFILE=$(echo ${MOZILLA_FIVE_HOME}/chrome/${MOZLANG}*.jar \ | |
33 | | sed 's/\s.*//g' ) | |
34 | if [ -f "$LANGFILE" ]; then | |
35 | MOZLANG=$(basename "$LANGFILE" | sed 's/\.jar//') | |
36 | MOZARGS="-UILocale $MOZLANG" | |
37 | break | |
38 | fi | |
39 | done | |
40 | fi | |
41 | ||
42 | if [ -n "$MOZARGS" ]; then | |
43 | ICEDOVE="$LIBDIR/icedove $MOZARGS" | |
44 | else | |
45 | ICEDOVE="$LIBDIR/icedove" | |
46 | fi | |
ceb3e54a | 47 | |
48 | if [ "$1" == "-remote" ]; then | |
49 | $ICEDOVE "$@" | |
50 | else | |
51 | PING=`$ICEDOVE -remote 'ping()' 2>&1 >/dev/null` | |
52 | if [ -n "$PING" ]; then | |
53 | $ICEDOVE "$@" | |
54 | else | |
55 | case "$1" in | |
56 | -compose|-editor) | |
57 | $ICEDOVE -remote 'xfeDoCommand (composeMessage)' | |
58 | ;; | |
59 | *) | |
60 | $ICEDOVE -remote 'xfeDoCommand (openInbox)' | |
61 | ;; | |
62 | esac | |
63 | fi | |
64 | fi |