I've recently set up my Ubuntu machine so that I run another X session in pty8. I mostly run virtual machines or remote desktop sessions on this other X server, which helps mediate some of the frustrations that can happen with keyboard integration in these environments.
However, now if I copy something from some window on :0, I can't paste it into some window on :1.
Is there a way I can share the clipboard between these two sessions?
Best Answer
I came up with a solution that seems to work pretty well. I'm not sure if there's a better way, but I wrote a script that starts my VM and then monitors the clipboard on display :0 for changes. When a change is detected, it copies the clipboard contents to display :1. It does this bidirectionally, so I can copy and paste from the VM just fine too.
Here's the script:
Then all that's needed is the command to start the second X session:
I haven't noticed any issues, but if anyone can think of a better way I'd definitely appreciate the input.