On Tue, Jul 09, 2002 at 01:37:27PM +0200, Nora Etukudo wrote:
> > >>  urlCommand     "mozilla '%s'"
> > 
> > urlCommand      "mozilla -remote 'openURL(%s)'"
> > 
> > doesn't work for you?
> 
> My experience is: If I use the longer form, than mozilla must be running
> already. With the other, shorter form it works in either case regardless
> mozilla is running already or not.

Put something like this into a script and always start mozilla by that
script (I call it xmozilla).

Usage:
xmozilla
xmozilla URL
xmozilla file
xmozilla dir

% cat /opt/bin/xmozilla 
#!/bin/ksh

MOZILLA="/opt/bin/mozilla"
URLHOME=
LOCK="$HOME/.mozilla_starting"

if [ "x$@" = "x" ] ; then
  URL="$URLHOME"
else
  URL="$@"
  if [ -f "$URL" -o -d "$URL" ] ; then
      if expr "$URL" : "/" ; then
          URL="file://$URL"
      else
          URL="file://`pwd`/$URL"
      fi
  fi
fi


while ! mkdir "$LOCK" ; do sleep 1 ; done

if ps -u "$USER" | grep mozilla-bin > /dev/null ; then
     "${MOZILLA}" -remote openURL\("$URL"\,new-window\) &
else
     "${MOZILLA}" "$URL" &
     sleep 2
fi

rmdir "$LOCK"


-- 
         Martin Mačok                 http://underground.cz/
   [EMAIL PROTECTED]        http://Xtrmntr.org/ORBman/

Reply via email to