I am having issues related with xclip
in a docker container.
echo "text" | xclip
which raises the error: Error: Can't open display: (null)
.
How can I programmatically add some text to host's clipboard from the container (in an OS independent way if possible)?
Thank you in advance.
UPDATE
DISPLAY
env variable is not set. How can I set it correctly?
Not OS independent, but you can mount your host's X11 socket:
More info: http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/