netscape-remote:
#!/usr/bin/perl
######################################################################
# The purpose of this script is to handle URL requests for Netscape. #
# If Netscape is already running, it will issue a netscape -remote #
# command to launch the URL in the already opened browser. #
# If Netscape is not already running it starts it with the specified #
# URL. #
# #
# Unfortunately this script fails if Netscape dies and leaves behind #
# a stale lockfile. You'll have to start Netscape manually the next #
# time if that happens. #
######################################################################
my $url;
if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }
if (-l "$ENV{'HOME'}/.netscape/lock") {
$NS_ID = `/usr/local/bin/get-ns-id`;
exec ("/usr/local/netscape/netscape -id $NS_ID -remote 'openURL($url)'");
else {Quote:}
-------------------------cut here-------------------Quote:}
get-ns-id:
#!/bin/tcsh
setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print $1}'`
setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
echo -n $NS_WIN_ID
--------------------------cut here--------------------
This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
You may need to tweak the paths a bit in your system to get it to work.
>> Does anyone know of a fix/workaround for the netscape --remove (openURL)
>> problem in KDE 2.1.1 ? Will this be fixed in 2.1.2?
> Here's my workaround - It involves a tweak to the perl script
> netscape-remote, and a new script, get-ns-id:
> netscape-remote:
> #!/usr/bin/perl
> ######################################################################
> # The purpose of this script is to handle URL requests for Netscape. #
> # If Netscape is already running, it will issue a netscape -remote #
> # command to launch the URL in the already opened browser. #
> # If Netscape is not already running it starts it with the specified #
> # URL. #
> # #
> # Unfortunately this script fails if Netscape dies and leaves behind #
> # a stale lockfile. You'll have to start Netscape manually the next #
> # time if that happens. #
> ######################################################################
> my $url;
> if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
> elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }
> if (-l "$ENV{'HOME'}/.netscape/lock") {
> $NS_ID = `/usr/local/bin/get-ns-id`;
> exec ("/usr/local/netscape/netscape -id $NS_ID -remote
> 'openURL($url)'");
> }
> else {
> exec ("/usr/local/netscape/netscape $url");
> }
> -------------------------cut here-------------------
> get-ns-id:
> #!/bin/tcsh
> setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print
> $1}'` setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
> echo -n $NS_WIN_ID
> --------------------------cut here--------------------
> This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
> You may need to tweak the paths a bit in your system to get it to work.
>>> Does anyone know of a fix/workaround for the netscape --remove (openURL)
>>> problem in KDE 2.1.1 ? Will this be fixed in 2.1.2?
>> Here's my workaround - It involves a tweak to the perl script
>> netscape-remote, and a new script, get-ns-id:
>> netscape-remote:
>> #!/usr/bin/perl
>> ######################################################################
>> # The purpose of this script is to handle URL requests for Netscape. #
>> # If Netscape is already running, it will issue a netscape -remote #
>> # command to launch the URL in the already opened browser. #
>> # If Netscape is not already running it starts it with the specified #
>> # URL. #
>> # #
>> # Unfortunately this script fails if Netscape dies and leaves behind #
>> # a stale lockfile. You'll have to start Netscape manually the next #
>> # time if that happens. #
>> ######################################################################
>> my $url;
>> if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
>> elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }
>> if (-l "$ENV{'HOME'}/.netscape/lock") {
>> $NS_ID = `/usr/local/bin/get-ns-id`;
>> exec ("/usr/local/netscape/netscape -id $NS_ID -remote
>> 'openURL($url)'");
>> }
>> else {
>> exec ("/usr/local/netscape/netscape $url");
>> }
>> -------------------------cut here-------------------
>> get-ns-id:
>> #!/bin/tcsh
>> setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print
>> $1}'` setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
>> echo -n $NS_WIN_ID
>> --------------------------cut here--------------------
>> This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
>> You may need to tweak the paths a bit in your system to get it to work.
> You can put the netscape-remote script anywhere on your system you want.
> Mine is in /usr/local/bin. This script is not a part of KDE or netscape.
> You can simply cut and paste it from my original followup to this thread.
Andrew
--
----------------------------------------------------------------------
Department of Astronomy (510) 642-7570
University of California, 601 Campbell Hall FAX 2-3411
Berkeley, CA 94720
PID 27349 doesn't exist on my PC. What's the problem?
--
Claus Tondering
> > Does anyone know of a fix/workaround for the netscape --remove (openURL)
> > problem in KDE 2.1.1 ? Will this be fixed in 2.1.2?
> Here's my workaround - It involves a tweak to the perl script
> netscape-remote, and a new script, get-ns-id:
> netscape-remote:
> #!/usr/bin/perl
> ######################################################################
> # The purpose of this script is to handle URL requests for Netscape. #
> # If Netscape is already running, it will issue a netscape -remote #
> # command to launch the URL in the already opened browser. #
> # If Netscape is not already running it starts it with the specified #
> # URL. #
> # #
> # Unfortunately this script fails if Netscape dies and leaves behind #
> # a stale lockfile. You'll have to start Netscape manually the next #
> # time if that happens. #
> ######################################################################
> my $url;
> if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
> elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }
> if (-l "$ENV{'HOME'}/.netscape/lock") {
> $NS_ID = `/usr/local/bin/get-ns-id`;
> exec ("/usr/local/netscape/netscape -id $NS_ID -remote 'openURL($url)'");
> }
> else {
> exec ("/usr/local/netscape/netscape $url");
> }
> -------------------------cut here-------------------
> get-ns-id:
> #!/bin/tcsh
> setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print $1}'`
> setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
> echo -n $NS_WIN_ID
> --------------------------cut here--------------------
> This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
> You may need to tweak the paths a bit in your system to get it to work.
> PID 27349 doesn't exist on my PC. What's the problem?
> --
> Claus Tondering
--
Claus Tondering
1. warning: action not found: openurl
3. kfmclient openURL & bindings
5. Having trouble mounting remote drives
6. IDE heads>16, Linux problems, DOS/OS-2 no problem!
7. start a remote porgram, having it running after closing telnet.
8. adding users
9. Nicer [FIX] Re: Hi, am having trouble with cpio-2.4.2 on S.u.S.E. 6.0
10. Still having trouble running remote X Apps.
11. linux box having trouble being a router -FIXED.
12. remote X display: Why do I keep having to run xhost?
13. If you are having problems with Red Hat 5.0 and aha152x here is a fix