echo "paste buffer here" | xsel #for X clipboard
echo "paste buffer here" | parcellite #for GNOME Clipboard
I even tried a script to make this a little better. However, this isn’t convenient enough. I looked around a little and found a way to integrate the screen and X clipboards. However, since I use byobu, which uses it’s own buffer (I think, since, there is no /tmp/screen-exchange file on my system), this didn’t work for me. I dug up a little and found byobu’s buffer file instead. It’s kept at $BYOBU_RUN_DIR/printscreen. Therefore, a tiny change in the screen method works for byobu:
Add this to ~/.byobu/keybindings
# Add cool line to make copying to x clipboard possible.
# This binds C-a b to copy screen's copy buffer to the system clipboard.
bind b eval writebuf 'exec /bin/sh -c "parcellite < $BYOBU_RUN_DIR/printscreen && xsel -i < $BYOBU_RUN_DIR/printscreen "'
Now, after you’ve put something into the screen copy buffer, press Ctrl a b (ctrl, then a, then b), and this buffer will be put into the X and GNOME clipboards!
It’s a hack. It works😉