]> git.pld-linux.org Git - packages/icedove.git/blame - icedove.sh
- restored UI locale forcing, users are stupid and shouldn't be able to do
[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
e98019c8 6# copy profile from Thunderbird if its available and if no Icedove
7# profile exists
8if [ ! -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
13fi
14
13040066 15MOZARGS=
16MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \
17 sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
18for 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
25done
26
27if [ -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
40fi
41
42if [ -n "$MOZARGS" ]; then
43 ICEDOVE="$LIBDIR/icedove $MOZARGS"
44else
45 ICEDOVE="$LIBDIR/icedove"
46fi
ceb3e54a 47
48if [ "$1" == "-remote" ]; then
49 $ICEDOVE "$@"
50else
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
64fi
This page took 0.051033 seconds and 4 git commands to generate.