-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Suggestion: Clipboard #105
Comments
wl-clipboard-rs is definitely a good starting point. It uses the same underlying library as the layer-shell backend in lan-mouse. There are however some additional problems to solve other than just interacting with the clipboard. I will just lay out some of my thoughts here for future reference:
Option (a) would be a lot easier to implement but I'm definitely leaning towards the second option because it does not require an additional port and protocol. There are however a few issues with it that need solving:
I'm also leaning towards the last option here because it would require the least amount of data being sent but I'm also not sure if it is possible to do via standard wayland protocols so I may just resort to option (b) at first. |
Copying the clipboard upon cursor entering client seems indeed the most reasonable. (And sounds that you almost need to manually implement your own TCP-like layer on top of UDP) |
Hum, maybe #107 could be a temporary solution for the clipboard: |
After giving it some thought this might actually not be the worst idea. Using |
Yup! My though also. wl-paste | ssh env WAYLAND_DISPLAY="wayland-0" ${remote} wl-copy and attack surface could even be further be reduced by using edit: environment variable from the actual command |
Couldn't the message size limitation be addressed in #104 when implementing DTLS? We wouldn't have any message/packet size issues when using QUIC or DTLS from what I see 🤔 |
DTLS is still packet based and those packets are limited in size. QUIC may be interesting to look into for the future but also does not solve the problem of prioritizing input events over clipboard data. For now, I want to keep using plain UDP with DTLS. |
Will check tomorrow if this works |
Seems to be working! (order of host and command was swapped) enter_hook = "wl-paste | ssh thorium env WAYLAND_DISPLAY='wayland-1' wl-copy" |
Let me know, if someone can figure out a way of copying files as well ;) |
Tested it with: enter_hook="wl-paste | ssh argo.fritz.box '-oIdentitiesOnly yes' -i .ssh/id_ed25519_clipboard" and in the remote's
WORKS! YAY! 🎊 🎊 🎊 When do you plan to tag the release? |
The main thing, I wanted to wait for was
I think it's probably a good idea to ignore that last part and make a release anyway. |
Addendum: Use the option enter_hook="wl-paste --no-newline | … |
Just a short update: Thanks for the support! |
This solution still requires external intervention (ie: hooks), right? doesn't work out of the box? is there a timeline for that? Thanks! |
As feschber has mentionned above, lan-mouse is designed around UDP sending small packets around without guarantee of arrival, which is fine for real-time input sharing (e.g.: 1 packet per mouse event). Clipboard content can be large and needs to be entirely transmitted, more the realm of TCP. Direct support would require re-engineering lan-mouse to support an entire separate protocol over TCP just for clipboards or re-implent its own content chunking, resend, etc. (i.e. reinvent a TCP-like on top of the existing UDP). Separating concerns and having lan-mouse concentrate on input forwarding and let other tech handle clipboard transfers as feschber has currently implemented it, is imho the way to go. |
As a suggestion - you may want to look at game udp protocol libraries for this, as they have solved many of these problems, as they are essentially the same as what you are trying to do. Some ideas:
|
Not sure, I Had a look around and found this one https://github.com/songokas/clipboard-sync |
Sounds like this could work standalone? I can definitely take some inspiration but will not be working on this until encryption is implemented. |
For sharing clipboard, I've found something that can both be used as a building block for users to make their workaround and which could be used to add clipboard support into lan-mouse:
wl-clipboard
It provides a pair of command that can read from- / write to- the wayland clipboard (and thus be used to store stuff in files, send over pipes or tunnels, etc.)
At the end of the readme, they also mention a rust crate wl-clipboard-rs handling the same which could be used for lan-mouse.
The text was updated successfully, but these errors were encountered: