-
Notifications
You must be signed in to change notification settings - Fork 39
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
Pasting in Wayland redux #157
Comments
Hope a solution is found, really miss Emote working properly now that I've gone to Fedora 40 and Wayland is default 😓 |
Running "wl-paste" in the terminal seems to just be printing the current clipboard content in the terminal, not pasting it at the current cursor location. |
@theamazing0 I'm not sure what you mean. If you are typing (If you want to test it in another location, try something like |
Yes, that's what I did. I ran the command to sleep and then wl-paste, and changed my cursor location to somewhere else in Firefox. I just read further, and saw you also tried ydotool, did these commands work if you ran them directly in the terminal? |
I was going to comment the same thing yesterday! (I tried it by prefixing sleep, obviously). In the Edit: So |
For pasting to support terminal as well, I'm trying using Ctrl+Shift+V. That shortcut works in Kitty, Chrome, and Firefox; though not Dolphin, Nautilus, or Gnome Settings (but that's acceptable for my usage). ydotool key 29:1 42:1 47:1 47:0 42:0 29:0 I noticed in |
Resolves tom-james-watson#157. Related: tom-james-watson#44. ydotool must be installed with ydotoold running
PR submitted |
Shouldn't the Wayland behavior be consistent with X? If it should be Ctl+v or Ctrl+Shift+v should be another issue, as the current X behavior is to use Ctrl+v, and the Wayland behavior should do the same thing for now. |
Sorry for double-posting. Much of my original comment is redundant to due more research. I've deleted that comment and added a new one here. Apologies @theamazing0 and @ZimbiX, you are totally correct.
I think this strategy is probably slightly neater than using ydotool to send a literal ctrl-v or ctrl-shift-v, because it's more direct. It doesn't depend on specific keyboard shortcuts of the program (as stated above by @ZimbiX ), and also it has less chance of failing if the user has another modifier held down. Even better is bypassing the clipboard as per my OP, i.e. using ydotool to directly type the emoji. This has even less chance of failing, and also doesn't pollute the clipboard. However, ydotool cannot type emoji, so that won't be an option. OTOH apparently wtype can type emoji, but this program doesn't work on KDE nor Gnome. Other alternatives are dotool and kdotool. I can have a look at these later. @ZimbiX Your trick of backgrounding the command with
EDIT: after more research, kdotool can't type characters, and dotool doesn't seem to work for emoji, giving me the error |
Hey all - thanks for thinking about this stuff - it would be awesome if we could get this working! See #161 (comment) - the difficult part is packaging the app so that this works out of the box with flatpak and/or snap, not just the invocation of the utils themselves. |
Thanks @tom-james-watson . I don't know a lot about it, but I suspect that the way Wayland works is to require a root daemon for security reasons. I think some of the other programs (e.g. dotool) also have a root component. Hence I suspect there's no way for a non-privileged user-installed version to paste in Wayland. If that is the case, could we just check for a running instance of ydotool, then if that exists use the ydotool command? Or maybe just run |
I think it's likely solvable in snap/flatpak directly, by someone with enough knowledge. I don't really want to ship features that require the user to manually install other packages and set up systemd services and things like that. |
Fair enough. I don't user snap/flatpack, but I just realised that it's possible to install them with root privileges, so you are probably correct that there might be a solution. |
Snap and Flatpak are the only officially supported installation methods, so any code changes need to work for them specifically. |
The backend of maliit keyboard could also be used. https://github.com/maliit/keyboard |
Pasting works on recent plasma wayland (6.2.3) |
I don't think that's possible. The code skips pasting if you're running wayland, and if not will use xdotool, which only supports X11. |
I just noticed I had ydotoold running for another reason. When I stop it, it no longer works |
Alright, it's from AUR packagers patch, sorry for noise: https://aur.archlinux.org/cgit/aur.git/tree/emote_wayland_autopaste.patch?h=emote |
Btw, at least on artix ydotoold isn't needed to be run as root |
I know Wayland has been discussed here before, but I think there is a way to paste emoji.
Emote is already using wl-clipboard, specifically
wl-copy
to copy the emoji. Hence, it should be straightforward to usewl-paste
from the same repository.Having said that, I tried messing with Emote's code, but I couldn't get it to work. I tried variations on the following.
but nothing ever pasted. FWIW I don't entirely understand how the code works here. Even in X11, isn't the "ctrl+v" operating while Emote is still in the foreground? I tried increasing the
sleep
, but this just delays how long the Emote window stays open.Another option could be using ydotool, e.g. pasting with
or even better, bypassing the clipboard and directly
However, neither of these worked for me either.
The text was updated successfully, but these errors were encountered: