]> git.pld-linux.org Git - packages/icedove.git/blob - icedove.sh
- damn, forgot to adapterize
[packages/icedove.git] / icedove.sh
1 #!/bin/sh
2 # based on script by (c) vip at linux.pl, wolf at pld-linux.org
3
4 LIBDIR="@LIBDIR@/icedove"
5
6 MOZARGS=
7 MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \
8                 sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
9 for 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
16 done
17
18 if [ -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
31 fi
32
33 if [ -n "$MOZARGS" ]; then
34         ICEDOVE="$LIBDIR/icedove $MOZARGS"
35 else
36         ICEDOVE="$LIBDIR/icedove"
37 fi
38
39 if [ "$1" == "-remote" ]; then
40         $ICEDOVE "$@"
41 else
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
55 fi
This page took 0.114105 seconds and 3 git commands to generate.