Any (easy)way to copy contents of a file into X clipboard?

Scott W wegster at mindcore.net
Fri Dec 26 08:01:08 PST 2003


Pat Lashley wrote:

> --On Sunday, December 21, 2003 20:50:22 -0500 Scott W 
> <wegster at mindcore.net> wrote:
> 
>>
>> Hey all..was wondering if anyone knew of a utlity to copy the contents
>> of a text file into an X clipboard buffer?
>>
>> It's possible via the use of xmessage or any other X editor that allows
>> you to select all text, but something command line only would be 
>> useful...
>> I'm sure something exists somewhere, but I'm not having any luck as of
>> yet...anyone?
> 
> 
> Have you tried /usr/ports/x11/xclip ?
> 
> 
> 
> -Pat
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at freebsd.org"
> 

Actually, no...it hadn't been installed, so I did so.  I just tried it, 
but it appears to have a buffer size limitation, or I may be using it wrong:
xclip -i /home/wegster/bsd/freeBSDInstall.txt
completes, but then doesn't seem to have filled the X clipboard buffer, 
as pasting into an open text file produces no output.

xclip -i Makefile (using xclips Makefile)
does work as advertised,

while cat /home/wegster/bsd/freeBSDInstall.txt | xclip
doesn't produce any output,

but
cat Makefile | xclip
works....so looks like a non-dynamic buffer being used.  If anyone has 
any ideas (cmd params I'm missing) I'd appreciate it, otherwise I'll dig 
into the source and see what it's doing with respect to buffer allocation.

Thanks,  (definately closer than I was )

Scott




More information about the freebsd-questions mailing list