x_clipboard icon indicating copy to clipboard operation
x_clipboard copied to clipboard

X11 copy/paste and XDnD in xlib.

Try:

./selection []

To copy the image to the in the form of a PNG, JPEG, TIFF, BMP URL string or text string. If you do not specify PRIMARY will be used.

./selection -dnd

To do the largely same, except with a window to drag the image from rather than holding it in the clipboard.

Then

./paste [ [type1 [type2 [ ... ] ] ] ]

Paste the data in or PRIMARY (select/middle click). You must specify if you want to specify which datatypes to fetch in order of preference. STRING is used if none are specified.

./paste -dnd [...]

to do the same, except it provides a window to drop things on to, instead of pasting from PRIMARY.

Operation of these programs is very verbose, and well documented in paste.cc