3

I'm using Xnest to run a nested X server inside my main X server.

But their clipboards (selections) are independent, so I cannot easily copy text from one to another. Is there a way to do so?

2 Answers 2

1

Inspired by this answer, I'm using xclip in this way:

#!/bin/sh
# copy from :0 to :1
xclip -selection clip -o -display :0 | xclip -selection clip -i -display :1

Swap :0 with :1 if you want to copy the other way around. This works for example in a browser with ctrlc and ctrlv.

1

I just ran into this problem last week and all the options I could find were unsatisfactory: they either have annoying delays, or only sync in one direction, or wake up the CPU unnecessarily. After some experimentation I made a script called xclipsync that solves the problem properly, even if you're syncing between multiple Xephyr/Xnest instances or screens.

https://github.com/apenwarr/xclipsync

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .