LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2004, 08:43 AM   #1
steste
Member
 
Registered: Aug 2004
Location: N Ireland
Distribution: Ubuntu - well trying to!
Posts: 31

Rep: Reputation: 15
launching multiple mozilla windows


I have just installed the latest version of mozilla and created a lauch icon for it on a panel. when i click on it a mozilla window opens as normal. however if i cllick on it again it refuses to open a new window and asks me to select a different profile. i only have ythej default profile. I know i can open a new window by pressing cntrl and N but i have got used to juct clicking on the icon when using the previous version. Any ideas on how to change this?
 
Old 08-16-2004, 09:01 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hi,

Why do you want to create multiple instances of Mozilla? You have a lot of memory and don't know how to use it?
What you can do is to configure your mozilla to open new tabs instead of new windows simply with a click-middle... which is great bec your desktop won't be messed up with tons of mozilla windows.

Oliv'
 
Old 08-16-2004, 09:06 AM   #3
steste
Member
 
Registered: Aug 2004
Location: N Ireland
Distribution: Ubuntu - well trying to!
Posts: 31

Original Poster
Rep: Reputation: 15
all i want moziila to do is open a new window whenever i click on its icon in a panel. I have got used to doing it that way and would like to continue doing it that way.
 
Old 08-16-2004, 09:10 AM   #4
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Try using this script to launch it
change the MOZILLA_FIVE_HOME variable to whereever you installed Mozilla.

note this works for Firefox and Thunderbird as well, you just need to change the name of the script.
 
Old 08-16-2004, 09:18 AM   #5
steste
Member
 
Registered: Aug 2004
Location: N Ireland
Distribution: Ubuntu - well trying to!
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Demonbane
Try using this script to launch it
change the MOZILLA_FIVE_HOME variable to whereever you installed Mozilla.

note this works for Firefox and Thunderbird as well, you just need to change the name of the script.
what do i do with that script? Sorry but im such a newbie to linux!!
 
Old 08-16-2004, 09:29 AM   #6
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
open it up with a text editor and modify MOZILLA_FIVE_HOME in
Code:
    *mozilla)
      export MOZILLA_FIVE_HOME="/usr/lib/mozilla"
      remote=$MOZILLA_FIVE_HOME/mozilla-xremote-client
      mozbin=$MOZILLA_FIVE_HOME/mozilla-bin
      grepfor=Mozilla-bin
      prefs=$HOME/.mozilla
      ;;
to where your mozilla is installed, put it in somewhere like /usr/bin and point the shortcut on the desktop to it(eg /usr/bin/mozilla)
 
Old 08-16-2004, 09:36 AM   #7
steste
Member
 
Registered: Aug 2004
Location: N Ireland
Distribution: Ubuntu - well trying to!
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Demonbane
open it up with a text editor and modify MOZILLA_FIVE_HOME in
Code:
    *mozilla)
      export MOZILLA_FIVE_HOME="/usr/lib/mozilla"
      remote=$MOZILLA_FIVE_HOME/mozilla-xremote-client
      mozbin=$MOZILLA_FIVE_HOME/mozilla-bin
      grepfor=Mozilla-bin
      prefs=$HOME/.mozilla
      ;;
to where your mozilla is installed, put it in somewhere like /usr/bin and point the shortcut on the desktop to it(eg /usr/bin/mozilla)
thank you for your patience. what do i save the file as? eg .txt?
 
Old 08-16-2004, 09:38 AM   #8
steste
Member
 
Registered: Aug 2004
Location: N Ireland
Distribution: Ubuntu - well trying to!
Posts: 31

Original Poster
Rep: Reputation: 15
sorry i thought i had it but it says i do not have the necessary permissions?
 
Old 08-16-2004, 09:52 AM   #9
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
you need to be root(type "su"), after you've modified it save it as "mozilla" with no extensions into /usr/bin then "chmod 755 /usr/bin/mozilla", then create a shortcut.
 
Old 08-16-2004, 09:56 AM   #10
steste
Member
 
Registered: Aug 2004
Location: N Ireland
Distribution: Ubuntu - well trying to!
Posts: 31

Original Poster
Rep: Reputation: 15
it doesnt do anything! the box flies out of it as if its opening but then....nothing!
 
Old 08-16-2004, 09:59 AM   #11
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
make sure MOZILLA_FIVE_HOME is set correctly, execute it in a terminal and see what happens (type "/usr/bin/mozilla")
 
Old 08-16-2004, 10:01 AM   #12
steste
Member
 
Registered: Aug 2004
Location: N Ireland
Distribution: Ubuntu - well trying to!
Posts: 31

Original Poster
Rep: Reputation: 15
as far as i can see it looks ok. nothing happens when its run in a terminal. well the window appears but only briefly and then dissappears again
 
Old 09-08-2004, 11:02 AM   #13
cfkang
LQ Newbie
 
Registered: Sep 2004
Distribution: RH9 RH8
Posts: 1

Rep: Reputation: 0
my 2 cents

I have a similar case in which I upgraded Mozilla 1.4 (from RH9) to Mozillar 1.7.2 downloaded directly from mozilla.org. The installation defaults to /usr/local/mozilla. After I installed the mozilla, I uninstalled the old one (1.4) but keep /usr/bin/mozilla. I modifiled it (a sh script) to point to the new location (/usr/local/mozilla) and it works. If you install mozilla in the same place as mine, you probably just need this file. Here is my /usr/bin/mozilla:

Code:
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation.  Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): 
#

## 
## Usage:
##
## $ mozilla
##
## This script is meant to run a mozilla program from the mozilla
## rpm installation.
##
## The script will setup all the environment voodoo needed to make
## mozilla work.

cmdname=`basename $0`

## don't leave any core files around
ulimit -c 0

##
## Variables
##
MOZ_DIST_BIN="/usr/local/mozilla"
MOZ_PROGRAM="/usr/local/mozilla/mozilla-bin"
MOZ_CLIENT_PROGRAM="/usr/local/mozilla/mozilla-xremote-client"

##
## Set MOZILLA_FIVE_HOME
##
MOZILLA_FIVE_HOME="/usr/local/mozilla"

export MOZILLA_FIVE_HOME

##
## Set LD_LIBRARY_PATH
##
if [ "$LD_LIBRARY_PATH" ]
then
  LD_LIBRARY_PATH=/usr/local/mozilla:/usr/local/mozilla/plugins:$LD_LIBRARY_PATH
else
  LD_LIBRARY_PATH=/usr/local/mozilla:/usr/local/mozilla/plugins
fi

export LD_LIBRARY_PATH

##
## Make sure that we set the plugin path for backwards compatibility
##
if [ "$MOZ_PLUGIN_PATH" ]
then
  MOZ_PLUGIN_PATH=$MOZ_PLUGIN_PATH:/usr/local/mozilla/plugins
else
  MOZ_PLUGIN_PATH=/usr/local/mozilla/plugins
fi
export MOZ_PLUGIN_PATH

# Figure out if we need to ser LD_ASSUME_KERNEL for older versions of the JVM.

function set_jvm_vars() {

    # see if the jvm exists in either of the locations
    if [ -L /usr/local/mozilla/plugins/libjavaplugin_oji.so ]; then
        JVM_ORIG_LINK=/usr/local/mozilla/plugins/libjavaplugin_oji.so
    fi

    if [ -L /usr/local/mozilla/plugins/libjavaplugin_oji.so ]; then
        JVM_ORIG_LINK=/usr/local/mozilla/plugins/libjavaplugin_oji.so
    fi

    if [ -z "$JVM_ORIG_LINK" ]; then
        return;
    fi

    JVM_LINK=`perl -e "print readlink('$JVM_ORIG_LINK')"`

    # is it relative?  if so append the full path

    echo "${JVM_LINK}" | grep -e "^/" 2>&1 > /dev/null

    if [ "$?" -ne "0" ]; then
	JVM_LINK=/usr/local/mozilla/plugins/${JVM_LINK}
    fi

    JVM_BASE=`basename $JVM_LINK`
    JVM_DIR=`echo $JVM_LINK | sed -e s/$JVM_BASE//g`
    JVM_COMMAND=$JVM_DIR/java
    if [ ! -r $JVM_COMMAND ]; then
       JVM_DIR=${JVM_DIR}../../../bin/
       JVM_COMMAND=$JVM_DIR/java
       # does the command exist?
       if [ ! -r "$JVM_COMMAND" ]; then
           return
       fi
    fi

    # export this temporarily - it seems to work with old and new
    # versions of the JVM.
    export LD_ASSUME_KERNEL=2.2.5

    # get the version
    JVM_VERSION=`$JVM_COMMAND -version 2>&1 | grep version | cut -f 3 -d " " | sed -e 's/\"//g'`

    unset LD_ASSUME_KERNEL

    case "$JVM_VERSION" in
	(1.3.0*)
	# bad JVM
	export LD_ASSUME_KERNEL=2.2.5
	;;
    esac
}

function check_running() {
    $MOZ_CLIENT_PROGRAM 'ping()' 2>/dev/null >/dev/null
    RETURN_VAL=$?
    if [ "$RETURN_VAL" -eq "2" ]; then
      echo 0
      return 0
    else
      echo 1
      return 1
    fi
}

function open_mail() {
    if [ "${ALREADY_RUNNING}" -eq "1" ]; then
      exec $MOZ_CLIENT_PROGRAM 'xfeDoCommand(openInbox)' \
        2>/dev/null >/dev/null
    else
      exec $MOZ_PROGRAM $*
    fi
}

function open_compose() {
    if [ "${ALREADY_RUNNING}" -eq "1" ]; then
      exec $MOZ_CLIENT_PROGRAM 'xfeDoCommand(composeMessage)' \
        2>/dev/null >/dev/null
    else
      exec $MOZ_PROGRAM $*
    fi
}

# OK, here's where all the real work gets done

# set our JVM vars
set_jvm_vars

# check to see if there's an already running instance or not
ALREADY_RUNNING=`check_running`

# If there is no command line argument at all then try to open a new
# window in an already running instance.
if [ "${ALREADY_RUNNING}" -eq "1" ] && [ -z "$1" ]; then
  exec $MOZ_CLIENT_PROGRAM "xfeDoCommand(openBrowser)" 2>/dev/null >/dev/null
fi

# check system locale
MOZARGS=
MOZLOCALE=`echo $LANG | sed "s|_\([^.]*\).*|-\1|g"`
[ -f $MOZILLA_FIVE_HOME/chrome/$MOZLOCALE.jar ] && MOZARGS="-UILocale $MOZLOCALE"


# if there's no command line argument and there's not a running
# instance then just fire up a new copy of the browser
if [ -z "$1" ]; then
  exec $MOZ_PROGRAM $MOZARGS 2>/dev/null >/dev/null
fi

unset RETURN_VAL

# If there's a command line argument but it doesn't begin with a -
# it's probably a url.  Try to send it to a running instance.

USE_EXIST=0
opt="$1"
case "$opt" in
  -mail)
      open_mail ${1+"$@"}
      ;;
  -compose)
      open_compose ${1+"$@"}
      ;;
  -*) ;;
  *) USE_EXIST=1 ;;
esac

if [ "${USE_EXIST}" -eq "1" ] && [ "${ALREADY_RUNNING}" -eq "1" ]; then
  # check to make sure that the command contains at least a :/ in it.
  echo $opt | grep -e ':/' 2>/dev/null > /dev/null
  RETURN_VAL=$?
  if [ "$RETURN_VAL" -eq "1" ]; then
    # if it doesn't begin with a '/' and it exists when the pwd is
    # prepended to it then append the full path
    echo $opt | grep -e '^/' 2>/dev/null > /dev/null
    if [ "${RETURN_VAL}" -ne "0" ] && [ -e `pwd`/$opt ]; then
      opt="`pwd`/$opt"
    fi
    exec $MOZ_CLIENT_PROGRAM "openurl($opt)" 2>/dev/null >/dev/null
  fi
  # just pass it off if it looks like a url
  exec $MOZ_CLIENT_PROGRAM "openurl($opt,new-window)" 2>/dev/null >/dev/null
fi

exec $MOZ_PROGRAM $MOZARGS ${1+"$@"}
Hope it works for you.
 
Old 09-08-2004, 04:24 PM   #14
Not now, John!
Member
 
Registered: Jul 2004
Distribution: LFS 5.1
Posts: 161

Rep: Reputation: 30
Here's my script. It works with Firefox 0.9.3.
Code:
#!/bin/sh
if [ `ps -C firefox-bin -o comm= | wc -l` -gt 0 ]; then
  /opt/firefox/mozilla-xremote-client -a firefox "openURL($1,new-window)"
else
  /opt/firefox/firefox "$1"
fi
You need to modify path to your Firefox installation directory.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mozilla Quit Launching ombill Fedora 3 08-12-2004 10:50 PM
launching mozilla from evolution irvken Linux - Software 3 08-11-2004 08:53 PM
mozilla 1.7 launching script mrpringle Linux - Software 3 07-09-2004 05:46 PM
mozilla launching problem stompinround Linux - Software 6 09-12-2003 05:53 PM
launching multiple apps with one command hamsterdude Linux - General 4 09-13-2002 02:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration