LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-27-2003, 10:17 AM   #16
jdolluc
Member
 
Registered: Jul 2003
Distribution: Debian
Posts: 31

Rep: Reputation: 15

i HIGHLY recommend OPERA. http://www.opera.com

it uses tabbed window broswing, so you can have 10-15 windows open at one time. check it out, it will save you headaches over mozilla
 
Old 08-27-2003, 10:37 AM   #17
Tsatellite81
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Rep: Reputation: 0
Yeah I dont know man. I like Firebird, it uses tabs too, I just cant get them to come up when I click on an external link. It's not really a huge deal, but hey, I know what I want. Thanks!

-T
 
Old 08-28-2003, 09:50 AM   #18
jdolluc
Member
 
Registered: Jul 2003
Distribution: Debian
Posts: 31

Rep: Reputation: 15
i have never had a problem with that in opera.

what distro are you running? most of the big ones have a precompiled binary for opera that sets up everything for you. i know all the debian info if you want it, but as for the other distros, im sure the info is out there.

Just suggestions, wont hurt my feelings if you choose something else.
 
Old 08-28-2003, 10:22 AM   #19
Tsatellite81
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Rep: Reputation: 0
I'm running Redhat 7.3 so you're right, there's probably something precompiled for me. I'll take a look at Opera since it comes so highly recommended...

-T
 
Old 08-30-2003, 05:37 PM   #20
papertygre
LQ Newbie
 
Registered: Aug 2003
Location: Sarasota, FL
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Tsatellite81,

I'm afraid I don't know - it looks like you're doing what the documentation recommends.
 
Old 11-24-2003, 03:20 AM   #21
bpk
Member
 
Registered: Nov 2003
Location: San Francisco, CA
Distribution: FreeBSD, OpenBSD, Gentoo, OS X
Posts: 80

Rep: Reputation: 15
Thanks for the script! works great!
 
Old 11-25-2003, 06:23 PM   #22
StamfordRob
Member
 
Registered: Jan 2002
Location: Stamford CT
Posts: 97

Rep: Reputation: 15
Question

well now.. scripts are great but lets get back to the original question for a moment.. the questioin was why does it do it.. i want to know how to disable it.. i only way it because if you do something as simple as control n you get a new window.. if i go and click help about i get a new window.. so what is the trigger that i can use on the panel shortcut to go around the profiles?? i also have an issue that when i use the start menu mozilla i can open as many as i want.. what is the difference there.. i dont see any different switches there??

r
** today i am running red 9.. installed mozilla 1.5..
 
Old 11-25-2003, 06:34 PM   #23
bpk
Member
 
Registered: Nov 2003
Location: San Francisco, CA
Distribution: FreeBSD, OpenBSD, Gentoo, OS X
Posts: 80

Rep: Reputation: 15
Well, from what I understand, Mozilla creates/opens a profile file that's 'locked' to that sessions. I guess this is because people may want multiple profiles per login sesion but personally.. I don't see the point (or at least my needs to not require such). Though I haven't tested it out; I think the locked file is either deleted or modified to allow the default profile to be loaded again, once mozilla is closed.

The script above seems to just spawn a window off that same profile (as you can manually via FILE > NEW WINDOW (Ctrl+N).

Im curious to find the right answer aswell tho. Is it really necessary to have profiles run like this?
 
Old 12-12-2003, 10:10 AM   #24
smither
LQ Newbie
 
Registered: Dec 2003
Posts: 2

Rep: Reputation: 0
I'm sure the script posted earlier works great, but here is a much simpler solution that works for me (I am using RH 9.0 and Moz 1.5):

I had been starting mozilla from a symbolic link in /usr/bin:

/usr/bin/mozilla => /usr/local/mozilla/mozilla

I replaced the link in /usr/bin/ with the following short script:

====================================
#! /bin/sh

# find pid of running moz, if any, for current user
PID=`ps -ef | grep $USER | grep /usr/local/mozilla/mozilla-bin |\
grep -v "grep" | awk '{print $2}'`

# if moz is not running, start normally
if [ $PID="" ]; then
/usr/local/mozilla/mozilla $1;

# otherwise, open url in a new window
else
/usr/local/mozilla/mozilla -remote "openurl($1,new-window)";
fi
====================================

That's it. Now when I click a link in an existing window it is followed as usual, but more to the point, when I click a link in an external program (for example, in evolution) when mozilla is already running a new moz window opens with the specified url.

Regards,
Bob Smither

Last edited by smither; 12-12-2003 at 05:31 PM.
 
Old 12-28-2003, 04:16 PM   #25
drspangle
LQ Newbie
 
Registered: Aug 2003
Posts: 26

Rep: Reputation: 15
Quote:
Originally posted by smither
I'm sure the script posted earlier works great, but here is a much simpler solution that works for me (I am using RH 9.0 and Moz 1.5):

I had been starting mozilla from a symbolic link in /usr/bin:

/usr/bin/mozilla => /usr/local/mozilla/mozilla

I replaced the link in /usr/bin/ with the following short script:

====================================
#! /bin/sh

# find pid of running moz, if any, for current user
PID=`ps -ef | grep $USER | grep /usr/local/mozilla/mozilla-bin |\
grep -v "grep" | awk '{print $2}'`

# if moz is not running, start normally
if [ $PID="" ]; then
/usr/local/mozilla/mozilla $1;

# otherwise, open url in a new window
else
/usr/local/mozilla/mozilla -remote "openurl($1,new-window)";
fi
====================================

That's it. Now when I click a link in an existing window it is followed as usual, but more to the point, when I click a link in an external program (for example, in evolution) when mozilla is already running a new moz window opens with the specified url.

Regards,
Bob Smither
Thank You!!!

I`ve been pulling my hair out about this particular issue and has kept me from fully enjoying my move to linux. Works great for Firebird also

 
Old 12-29-2003, 10:16 AM   #26
papertygre
LQ Newbie
 
Registered: Aug 2003
Location: Sarasota, FL
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Quote:
Originally posted by smither
I'm sure the script posted earlier works great, but here is a much simpler solution that works for me (I am using RH 9.0 and Moz 1.5):
Thank you! The previous script did work great, until 0.7, then it stopped working because the invocation would no longer silently fail with an error exit code if mozilla was already running, instead it would pop up a dialog box that had to be manually dismissed. And the -ping() option that the documentation options says that mozilla understands, doesn't seem to do anything. So this is a great solution, yay.

Cheers,
- Ratha
 
Old 01-19-2004, 09:01 PM   #27
StamfordRob
Member
 
Registered: Jan 2002
Location: Stamford CT
Posts: 97

Rep: Reputation: 15
Quote:
Originally posted by smither
I'm sure the script posted earlier works great, but here is a much simpler solution that works for me (I am using RH 9.0 and Moz 1.5):

I had been starting mozilla from a symbolic link in /usr/bin:

/usr/bin/mozilla => /usr/local/mozilla/mozilla

I replaced the link in /usr/bin/ with the following short script:

====================================
#! /bin/sh

# find pid of running moz, if any, for current user
PID=`ps -ef | grep $USER | grep /usr/local/mozilla/mozilla-bin |\
grep -v "grep" | awk '{print $2}'`

# if moz is not running, start normally
if [ $PID="" ]; then
/usr/local/mozilla/mozilla $1;

# otherwise, open url in a new window
else
/usr/local/mozilla/mozilla -remote "openurl($1,new-window)";
fi
====================================

That's it. Now when I click a link in an existing window it is followed as usual, but more to the point, when I click a link in an external program (for example, in evolution) when mozilla is already running a new moz window opens with the specified url.

Regards,
Bob Smither
**

ok so i took some time off from this.. but i'm back and see that there have been more positives to using scripts then actually correcting the annoyance.. how do i apply this script?? being new scripting in linux i need some guidance.. thanks..

r
 
Old 02-21-2004, 03:14 PM   #28
papertygre
LQ Newbie
 
Registered: Aug 2003
Location: Sarasota, FL
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Here is the newest version of the launch script I use, written for Firefox 0.8. I am happy to say that it works Real Good. It launches a given link or file in a new window, whether or not the browser has been already launched in the current session.

As before, in the code below, the leading whitespace on all the lines has been stripped out by the board, so it does not look as nice as it could. Also, the string "about:blank" should not have a space in it - the board inserts that automatically it seems.

To use this, you will need to customize the paths at the top of the file to correspond to your own machine's setup. Then you can put this script into /usr/local/bin as 'firefox' (you will have to do this as root) and then you can launch it from any command line as 'firefox <url>".

To make Thunderbird launch this script when you click on a link in email, run gnome-control-center, go to advanced, preferred applications, web browser, custom, and enter: 'firefox %s'. In GAIM, it's a little easier, you can just go into the preferences and do the same.

Enjoy.

Code:
#!/bin/sh

# This script is for Mozilla or Mozilla Firefox, which only lets you
# run one session at a time (though you can have multiple windows open
# in the session.) Thus a different command is necessary to launch
# a window with a given URL, depending on whether you already have the
# program running or not.

# Opens a new window with the requested URL (Or an empty window,
# if no URL requested on the command line.) This version does not
# accept parameters for the browser, only a URL or a filename.
# Special characters (e.g., spaces) in a filename should be handled
# gracefully, except for literal slashes in a filename, those
# probably wouldn't be handled well.

# Requires Perl.

# Documentation on the method for contacting the running process:
# http://www.mozilla.org/unix/remote.html

export MOZILLA_HOME=/usr/lib/firefox-0.8
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOZILLA_HOME
BROWSER="${MOZILLA_HOME}/firefox"

# Customizable options here
DEFAULT="about:blank"


# Function to urlencode a string.
# Accepts one parameter (multiple params are treated as one w/ embedded spaces)
# and sticks the result into a variable called urlencoded_rv.
function urlencode () {
string="$*"
strlen=${#string}
rv=""
i=0
while [ $i -lt $strlen ]; do
thischar=${string:$i:1}
case $thischar in
'"')
rv="$rv%52"
;;
' ')
rv="$rv%20"
;;
[a-zA-Z0-9]|'.'|'/'|'-'|'_'|':')
# Leave dots, slashes, etc. alone
rv="$rv$thischar"
;;
*)
code=`perl -e "printf \"%x\", ord(\"$thischar\")"`
#echo "'$thischar' => ~~$code~~"
if [ "${#code}" != "2" ]; then
rv="$rv%0$code"
else
rv="$rv%$code"
fi
;;
esac

i=$(($i+1))

done
urlencoded_rv=$rv
}


# Use the script parameter, or if missing, use the default
arg=${*:-$DEFAULT}
#echo "Arg: $arg"

# If it's a file, provide it with the 'file://' protocol and absolute path
if [ -f "$arg" ]; then
if [ "${arg:0:1}" != "/" ]; then
arg="`pwd`/$arg"
fi

# urlencode the filename (could have spaces, etc. in it).
# We need to urlencode because the '-remote' option won't take
# an unescaped value surrounded by quote chars.
urlencoded_rv=""
urlencode "$arg"
arg=$urlencoded_rv

arg="file://$arg"
fi

# Try remote first
$BROWSER -remote "openURL($arg, new-window)" 2>/dev/null && exit 0

# if remote failed, then launch the browser
$BROWSER $arg &
 
Old 06-27-2004, 10:19 PM   #29
FreakboY
Member
 
Registered: Jun 2002
Location: TX, USA
Distribution: Slackware
Posts: 385

Rep: Reputation: 32
all those scripts/codes are great..!!!!!!!!

better solution!!!

firefox %u
or
mozilla %u

use it with your launcher....

i use gnome, and i have an icon in the taskbar!!
i have no problems at all......!!!


Regards,

Last edited by FreakboY; 06-27-2004 at 10:36 PM.
 
Old 06-28-2004, 08:52 AM   #30
papertygre
LQ Newbie
 
Registered: Aug 2003
Location: Sarasota, FL
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Quote:
Originally posted by FreakboY
better solution!!!

firefox %u
or
mozilla %u
Oh, sure. Go the easy way and use the distro's script...

When I wrote these I wasn't aware that Debian had firefox... but when I noticed it I switched to using that and I retired the script quoted above.

The original problem was that the binaries that came with Firefox/Mozilla couldn't be launched directly if they were already running, because you would get the Profile dialog box if you tried, so there needed to be a wrapper script that would check if it was already running and if so, call remotely to it to open a new window with the requested URL, and otherwise just launch the browser anew. The stock distribution didn't have such a script, so that's what the stuff above attempts to be.

But yeah, I'm as happy as the next person to just use what the distributor packages if it's there. MUCH easier to maintain. I wonder if the stock distribution has this kind of script now too.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[ ] @ are driving me crazy FireInTheDark Linux - Software 1 11-28-2004 09:42 AM
gnuplot 4.0 is driving me crazy windowsrefund Linux - Software 1 09-01-2004 07:42 AM
Help this is driving me crazy!!!!!! Wolfy Linux - Hardware 1 07-07-2004 01:32 AM
Install driving me crazy lmanwarren *BSD 8 04-19-2004 10:16 PM
rhythmbox driving me crazy... Camasii Linux - Software 4 01-22-2004 09:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:56 AM.

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
Open Source Consulting | Domain Registration