xcut is a surprisingly useful program which manipulates the X Windows cut buffer from the command line and also through shell pipelines.