[wellylug] Wellylug: New Poll

David Antliff dave.antliff at paradise.net.nz
Tue Dec 7 11:21:19 NZDT 2004


On Tue, 7 Dec 2004, Richard Hector wrote:
>> I would like something to click on (well, highlight and invoke
>> mozilla-remote via xclip since I use Pine) that takes me straight there.
>
> Can't you just highlight and middle click in your mozilla window?
>
> That's what I normally do (from mutt, into firefox).

I'm glad you asked that - now I can tell you about my cool little 
select-url system I devised:

First, I have one of my extra side buttons on my mouse bound to run a 
script I call clipurl:


-- snip --

#!/bin/bash
# opens a new tab at selected URL in mozilla-like browser
#
# Copyright 2004 David Antliff <dave.antliff at paradise.net.nz>
# This program is distributed under the terms of the GPL version 2.
#
# Last changed:
# 20041207

# Where to find/open the browser
DISPLAY=:0.0
SCREEN=7

if test -z "$BROWSER"
then
     BROWSER='/usr/bin/mozilla'
fi


# fix URLs that span multiple lines and may have injected spaces
# (e.g. Pine)
URL=`xclip -o | tr '\n' ' ' | sed 's/\s//g'`
echo clipurl: $URL

PING=`$BROWSER -remote 'ping()' 2>&1`


if test -z "$PING"
then
     echo $BROWSER: opening new tab
     wmctrl -s $SCREEN
     $BROWSER -remote "openURL($URL,new-tab)" &
else
     echo $BROWSER: starting new session
     wmctrl -s $SCREEN
     $BROWSER $URL &
fi

-- snip --

My HOWTO here shows you how to do this:

http://gentoo-wiki.com/HOWTO_Mouse_Nav_Buttons


So all I have to do is select an URL (usually by tripleclick or double+1 
for multi-line urls) in Pine and then click the side button and the page 
opens in any existing firefox (or mozilla) browser as a new tab. If no 
browser exists, it opens a new one.

Neat huh? No need to waste brain cycles or arm muscle movements trying to 
locate the browser and then make sure you right click on something 
non-clickable. The wmctrl commands even bring the browser's workspace into 
view as long as you know what it is in advance (I use a particular 
workspace for each application - a grand total of 16 workspaces over two 
monitors)  ;)

-- 
David.





More information about the wellylug mailing list