]> git.pld-linux.org Git - packages/icedove.git/blob - icedove.sh
- avoid subdirs
[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 # copy profile from Thunderbird if its available and if no Icedove
7 # profile exists
8 if [ ! -d $HOME/.icedove ] && [ -d $HOME/.thunderbird ]; then
9         echo "Copying profile from Thunderbird"
10         cp -a $HOME/.thunderbird $HOME/.icedove
11 fi
12
13 # compreg.dat and/or chrome.rdf will screw things up if it's from an
14 # older version.  http://bugs.gentoo.org/show_bug.cgi?id=63999
15 for f in ~/.icedove/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do
16         if [[ -f ${f} && ${f} -ot "$0" ]]; then
17                 echo "Removing ${f} leftover from older Icedove"
18                 rm -f "${f}"
19         fi
20 done
21
22 ICEDOVE="$LIBDIR/icedove"
23
24 if [ "$1" == "-remote" ]; then
25         $ICEDOVE "$@"
26 else
27         PING=$($ICEDOVE -remote 'ping()' 2>&1 >/dev/null)
28         if [ -n "$PING" ]; then
29                 exec $ICEDOVE "$@"
30         else
31                 case "$1" in
32                 -compose|-editor)
33                         exec $ICEDOVE -remote 'xfeDoCommand (composeMessage)'
34                         ;;
35                 *)
36                         exec $ICEDOVE -remote 'xfeDoCommand (openInbox)'
37                         ;;
38                 esac
39         fi
40 fi
This page took 0.03698 seconds and 4 git commands to generate.