Closed AdrienLemaire closed 4 years ago
Thanks for such a detailed ticket! If only others filed their issues with this amount of detail :)
I couldn't figure out how to get wl-paste to print the text in my vim pane.
Any idea why wl-paste doesn't work as expected, and what to do to fix it?
I don't understand why you would actually expect it to output the text into your vim pane. wl-paste
outputs the clipboard contents to its stdout (which is the system journal if you start gdm from systemd, sway from gdm and wl-paste
from sway). It does not ask the "current" application to paste from clipboard into its focused text field — that is a very different thing and that is roughly the effect ydotool key ctrl+shift+v
has.
If you want wl-paste
's output to go to vim, you have to find a way to have its stdout connected to vim. This usually means actually running wl-paste
from inside vim, not from Sway. But then if you do that, why even bother with the clipboard.
Again, I'm not sure why would you expect this to work any differently, conceptually, than with X11, where you do use xdotool
. Maybe you can explain how do you expect this to work?
@bugaevc sorry about that, I got confused and made incorrect assumptions. You lovely explained how things should work, thank you very much for taking that time. Really appreciated :heart_eyes:
Pro tip: you've got a Useless Use Of Cat there: just wl-copy < $CONFIG/$KEY
would work as well :smile: (unless you're relying on being able to paste multiple suggestions at the same time, of course)
Hi, and thanks for making and maintaining wl-clipboard! Really can't leave neovim since it supports wl-clipboard by default.
I've recently switched from i3 to sway, and updated the following script to handle text snippet completion:
Here's a working script using wl-copy and ydotool:
This is binded in my sway conf as follow
I believe the ydotool dependency to be unnecessary, but I couldn't figure out how to get wl-paste to print the text in my vim pane. I can only see the message printed in journalctl logs as /usr/lib/gdm-wayland-session.
I thought it might be something to do with seats, but a
swaymsg -t get_seats
only returns seat0, andwl-paste -s seat0
didn't change anything. Using the primary clipboard with wl-copy and wl-paste had no effect as well.Any idea why wl-paste doesn't work as expected, and what to do to fix it?