[wellylug] default browser in KDE (lazy question)

David Antliff dave.antliff at paradise.net.nz
Wed May 5 00:26:34 NZST 2004


On Wed, 5 May 2004, Tim Nicholas wrote:
> This is my doggy script. It's cheap, it's nasty, but it seems to mostly
> work.
...
> #!/bin/bash
> #
> browserpath="/usr/bin"
> browsercommand="mozilla"
>
> cd $browserpath
> ( ./$browsercommand -remote "openURL($*, new-tab)" || ./$browsercommand
> $* )&
>

Here's a variation on the theme:

#!/bin/bash
URL=`xclip -o`
if mozilla -remote 'ping()'
then
        /usr/bin/mozilla -remote "openURL($URL, new-tab)"
else
        /usr/bin/mozilla $URL
fi


You can replace `xclip -o` with any URL or parameter you want (e.g. $1).
As with the other one, this script will open a new mozilla window if
there's no mozilla running, or a new tab in an already existing mozilla window.

I actually use this via one of the side buttons on my mouse, so I can
select any URL on-screen and click the button to open that in an existing
mozilla as a new tab. xclip -o outputs the current 'clipboard' contents.

Cheers,
David.




More information about the wellylug mailing list