View Single Post
  #30   Report Post  
Posted to rec.crafts.metalworking
DoN. Nichols DoN. Nichols is offline
external usenet poster
 
Posts: 2,600
Default Trepanning and Parting Off / Handling URL's

On 2008-05-06, James Waldby wrote:
On Tue, 06 May 2008 05:08:39 +0000, DoN. Nichols wrote:
On 2008-05-05, James Waldby wrote:


[ ... ]

Add the following near the beginning of the script:
URL="`xclip -o | tr -d '\n'`"


[snip re fetch and compile xclip]

Hmm ... "Reads from standard in, or from one or more files,"


Later in the man page: "xclip can also print the contents of a selection
to standard out with the -o option." Also see last example in man page.


Aha! It was too late, and I was trying to get through my usenet
reading before crashing. I've now tested that feature, and it works.

But the script is invoked as:

op URL-goes-here

and when URL occupies three lines, this would still be:

op FIRST-LINE-OF-URL (opera barfs because of incomplete URL)
SECOND-LINE-OF-URL (shell barfs, because it is expecting a new valid
command) THIRD-LINE-OF-URL (shell barfs, because it is expecting a new
valid command)

So -- unless you can see a way to drop the cut-and-paste as
standard input for the script, I don't see how this can work.

...

I meant that you'd change the script to invoke without command line
parameters. Get URL from current selection. The current selection
is whatever you most recently copied or cut or xclip -i'd.
For example, when I left drag the mouse cursor over the two lines:
test 1 @ 2 $ 3 % 4
test 5 ? 6 # 7 ! 8
and then execute URL="`xclip -o | tr -d '\n'`"; echo "/$URL/"
bash displays: / test 1 @ 2 $ 3 % 4 test 5 ? 6 # 7 ! 8/


O.K. I currently have it set so if there is nothing on the
command line, it fires it up looking at my own home page. I could
instead modify it so if there is nothing on the command line, it uses
xclip(1) instead. That would break less of what I do with it. Perhaps
add another feature so if there is a single '.' as an argument, it still
brings up my home page.

Thanks much,
DoN.

--
Email: | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---