]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.sh
- drop "
[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="$(/usr/bin/locale | grep "^LC_MESSAGES=" | sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
13 eval MOZLOCALE="$(echo $MOZLOCALE | sed -e "s|_\([^.]*\).*|-\1|g")"
14
15 [ -f $MOZILLA_FIVE_HOME/chrome/$MOZLOCALE.jar ] && MOZARGS="-UILocale $MOZLOCALE"
16
17 if [ -n "$MOZARGS" ]; then
18         FIREFOX="$LIBDIR/firefox $MOZARGS"
19 else
20         FIREFOX="$LIBDIR/firefox"
21 fi
22
23 if [ "$1" == "-remote" ]; then
24         $FIREFOX "$@"
25 else
26         PING=`$FIREFOX -remote 'ping()' 2>&1 >/dev/null`
27         if [ -n "$PING" ]; then
28                 if [ -f "`pwd`/$1" ]; then
29                         $FIREFOX "file://`pwd`/$1"
30                 else
31                         $FIREFOX "$@"
32                 fi
33         else
34                 if [ -z "$1" ]; then
35                         $FIREFOX -remote 'xfeDoCommand (openBrowser)'
36                 elif [ "$1" == "-mail" ]; then
37                         $FIREFOX -remote 'xfeDoCommand (openInbox)'
38                 elif [ "$1" == "-compose" ]; then
39                         $FIREFOX -remote 'xfeDoCommand (composeMessage)'
40                 else
41                         if [ -f "`pwd`/$1" ]; then
42                                 URL="file://`pwd`/$1"
43                         else
44                                 URL="$1"
45                         fi
46                         grep browser.tabs.opentabfor.middleclick ~/.mozilla/firefox/*/prefs.js | grep true > /dev/null
47                         if [ 0 -eq 0 ]; then
48                                 $FIREFOX -remote "OpenUrl($URL,new-tab)"
49                         else
50                                 $FIREFOX -remote "OpenUrl($URL,new-window)"
51                         fi
52                 fi
53         fi
54 fi
This page took 0.076729 seconds and 4 git commands to generate.