However, download and install xclip and the clipboard is yours to command.
xclip allows access to both the PRIMARY (middle mouse button) and SECONDARY (standard copy/paste) selections.
By default piping into xclip puts the text in the PRIMARY clipboard (middle mousebutton).
> echo $RANDOM | xclip
> xclip -o
4807
You can define which selection to input to. Say you want to store text in the SECONDARY selection (accessed using standard cut and paste commands):
> echo $RANDOM | xclip -sel 'clipboard'
> xclip -o -sel 'clipboard'
4807
You can now use edit->paste to output the text. Note that the random number was the same as before. I guess this is some shell caching mechanism. For a new random number each time you have to use a new shell:
> (echo $RANDOM) | cat
1297
No comments:
Post a Comment