Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Command-Line Access to the Clipboard

__/ [ Roy Schestowitz ] on Sunday 16 July 2006 09:51 \__

> __/ [ Michael Heiming ] on Sunday 16 July 2006 09:25 \__
> 
>> In comp.os.linux.misc Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx>:
>>> Hi all,
>> 
>>> Is there a way of accessing the content of the clipboard from the command
>>> line? I have Klipper running if that matters. At present, I need to paste
>> 
>> cboard=`dcop klipper klipper getClipboardContents`
>> echo $cboard
>> 
>> Should do the trick.
>> 
>> [..]
>> 
>> Good luck
> 
> Michael,
> 
> You're a star. Thanks for that.

FWIW,  here's  what  I later on achieved, in  case  you  are
curious  or  ever wish to use this. There is a  Perl  script
called  paradj  which  justifies text. It is based  on  some
LaTeX  code. What I wanted to have is a mechanism whereby  I
highlight   any  text  and  then,  by  pressing   Ctrl+Alt+7
(assigned  using  xbindkeys),  have the  clipboard  contents
transformed  to  be in justified form. Here is a  simplified
example of script:


,----[ indent.sh ]
| cboard=`dcop klipper klipper getClipboardContents`
| echo $cboard > ~/in
| perl ~/Main/Programs/paradj/paradj.pl --width=60  -n -b ~/in > ~/out
| dcop klipper klipper setClipboardContents "$(cat ~/out)"
`----

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index