]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.sh
- added runtime language support
[packages/firefox.git] / mozilla-firefox.sh
1 #!/bin/sh
2 # based on script by (c) vip at linux.pl, wolf at pld-linux.org
3
4 if [ `arch` == "x86_64" ]; then
5         LIBDIR="/usr/lib64/mozilla-firefox"
6 else
7         LIBDIR="/usr/lib/mozilla-firefox"
8 fi
9
10 MOZILLA_FIVE_HOME=$LIBDIR
11
12 MOZLOCALE=`echo $LANG | sed "s|_\([^.]*\).*|-\1|g"`
13
14 [ -f $MOZILLA_FIVE_HOME/chrome/$MOZLOCALE.jar ] && MOZARGS="-UILocale $MOZLOCALE"
15
16 if [ -n "$MOZARGS" ]; then
17         FIREFOX="$LIBDIR/firefox $MOZARGS"
18 else
19         FIREFOX="$LIBDIR/firefox"
20 fi
21
22 if [ "$1" == "-remote" ]; then
23         $FIREFOX "$@"
24 else
25         PING=`$FIREFOX -remote 'ping()' 2>&1 >/dev/null`
26         if [ -n "$PING" ]; then
27                 if [ -f "`pwd`/$1" ]; then
28                         $FIREFOX "file://`pwd`/$1"
29                 else
30                         $FIREFOX "$@"
31                 fi
32         else
33                 if [ -z "$1" ]; then
34                         $FIREFOX -remote 'xfeDoCommand (openBrowser)'
35                 elif [ "$1" == "-mail" ]; then
36                         $FIREFOX -remote 'xfeDoCommand (openInbox)'
37                 elif [ "$1" == "-compose" ]; then
38                         $FIREFOX -remote 'xfeDoCommand (composeMessage)'
39                 else
40                         if [ -f "`pwd`/$1" ]; then
41                                 URL="file://`pwd`/$1"
42                         else
43                                 URL="$1"
44                         fi
45                         grep browser.tabs.opentabfor.middleclick ~/.mozilla/firefox/*/prefs.js | grep true > /dev/null
46                         if [ 0 -eq 0 ]; then
47                                 $FIREFOX -remote "OpenUrl($URL,new-tab)"
48                         else
49                                 $FIREFOX -remote "OpenUrl($URL,new-window)"
50                         fi
51                 fi
52         fi
53 fi
This page took 0.07478 seconds and 4 git commands to generate.