Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clipboard confirmation Ctrl + shift + c / Ctrl + shift + v #152

Closed
hfont opened this issue May 1, 2019 · 8 comments
Closed

clipboard confirmation Ctrl + shift + c / Ctrl + shift + v #152

hfont opened this issue May 1, 2019 · 8 comments

Comments

@hfont
Copy link

hfont commented May 1, 2019

Looking at the Qubes we can see how they handle the clipboard

X11docker with this function would be interesting

I was researching on and found xephyr + xclip

https://github.com/vn971/dotfiles/blob/master/bin/xephyr-xclip-get.rs
https://github.com/vn971/dotfiles/blob/master/bin/xephyr-xclip-put.rs

Thanks for building x11docker

@mviereck mviereck added the bug label May 1, 2019
@mviereck
Copy link
Owner

mviereck commented May 1, 2019

Hello,

x11docker already has an option --clipboard and uses xclip or xsel if available.
However, I just checked it, it seems not to work as it should with Xephyr.

X server options --nxagent, --xpra and --hostdisplay use different mechanisms and do work as expected.

I'll look into this.

@hfont
Copy link
Author

hfont commented May 2, 2019

I had tested the --clipboard, and as you already mentioned works in all but Xephyr.

I've checked that --clipboard syncs the clip, but I do not think we always want to share all the clips, just a few, here comes the cofirmation so that only what we want is synchronized like in Qubes.

Thank you for replying

@mviereck
Copy link
Owner

mviereck commented May 3, 2019

I've fixed the clipboard issue in new release v5.6.0. Now it works in Xephyr again.

Note that Xephyr has a keyboard combination CTRL+SHIFT to grab mouse and keyboard. You need to press CTRL+SHIFT again to release them. Inserting clips in a terminal with CTRL+SHIFT+V works anyway. The current state of the lock is shown in the Xephyr window title.

I've checked that --clipboard syncs the clip, but I do not think we always want to share all the clips, just a few, here comes the cofirmation so that only what we want is synchronized like in Qubes.

It is an interesting thought to ask for synchronisation instead of sharing all the time.
I am not sure how I could implement that in a comfortable way. Asking for each single clip for all running x11docker instances would be terrible.
Watching possible paste actions all the time is not a way for x11docker. How does Qubes handle that?

@hfont
Copy link
Author

hfont commented May 3, 2019

I think they explain it better than I do.

https://www.qubes-os.org/doc/copy-paste/

@mviereck mviereck added enhancement and removed bug labels May 3, 2019
@mviereck
Copy link
Owner

mviereck commented May 5, 2019

I have thought a bit about this.

It would be possible to develop an semi-independent application that lists the clipboard content of all running X servers and pastes its content into others on demand. (Independent from x11docker option --clipboard).
However, I am not sure if it is worth the effort. How many users would really use it?

Another attempt could be a systray icon with a menu to enable/disable clipboard sharing for each X server/container.

@hfont
Copy link
Author

hfont commented May 6, 2019

Maybe there's no need for the shift because that's exactly what breaks the flow of people.

If something like this is possible, it would be magical.

  1. Intercept Ctrl + v from the x server (active window)

  2. If "Ctrl + v" takes the last clip from all running X servers, send it to the X server of the active window and paste it.

I do not know the right way to do this because I do not know it that much, I broke my mind yesterday to install full disk encryption in archlinux :) (problem grub does not support luks2)

Thank you for thinking about it.

@mviereck
Copy link
Owner

I did not find a way to watch the keyboard without too much overhead.

I could develop a clipboard helper script that can exchange clipboard content between different X servers in a GUI. But I doubt it would be used that often that it is worth the effort.

I've decided to leave it as it is.

@mviereck
Copy link
Owner

I have added some optional arguments to option --clipboard for better isolation and security. From x11docker --help:

 -c, --clipboard [=yes|no|oneway|superv] Share clipboard. Possible arguments:
                         yes:    Share clipboard in both directions.
                                 Includes middle-mouse-click selection.
                         oneway: Copy clipboard from container to host only.
                         superv: Keys [Super][V] copy clipboard from host to 
                                 container. Does not copy middle-mouse-click
                                 to container. Otherwise same as 'oneway'.
                         no:     Do not share clipboard.

With --clipboard=superv it should be secure and useful at the same time.
The container only gets host clipboard content if one presses keys [Super] [V] while a container window is in focus.
On the other way around, the host always gets clipboard content from container without further user action.
This option needs xbindkeys additionally to xclip.

@mviereck mviereck removed the wontfix label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants