Alt+(some number) paste does not work
Hello! I am using Arch with Hyprland.
The picker works great when I use rofimoji -a clipboard and press enter. However, when I use Alt+(some number) to select from the recent items, it simply does not paste anything (tested in chrome, vscode).
When I run rofimoji -a clipboard from the alacritty terminal, I get 4~ as output.
Could you please test it with a simple text editor (something not Electron- or Chrome-based), please?
And which clipboarder do you use?
In Vim (launched through rofi), nothing is printed, and the same situation in the Gnome text editor
clipboarder: wl-clipboard 1:2.2.1-2 and i dont have xsel or xclip installed
Is the character added to the clipboard?
No, only a newline is added to the clipboard. For example, if I try to use the recent emoji five times, the first line will be my copied text, and then five empty lines.
I also noticed an interesting behavior: if I copy anything and then try to use a recent emoji, it will work only once (until I copy something else).
Nevermind, it sometimes works, but it's completely random and I can't see any logic behind it.
And also when it works, 1 newline anyways adding to my buffer
if I try to use the recent emoji five times, the first line will be my copied text, and then five empty lines.
Can you please explain this in more detail? What exactly do you do, what do you press?
if I copy anything and then try to use a recent emoji, it will work only once
So, you have something in the clipboard, then you use rofimoji to insert a recent emoji via the clipboard, it works. You open rofimoji again and hit Alt+<number> and now it doesn't insert anything?
Hey, have you made any progress here?
I'm sorry for taking so long to respond. I have figured out the issue. If I press "Alt" and a number and then quickly release the "Alt" key, it will always paste. However, if I am slow and don't release the "Alt" button after pressing "Alt" + the number, nothing will paste.
And newline is anyways adds to my buffer
I think I found a bug in the code to restore the previous clipboard contents. Could you please try the branch fix/restore-clipboard-content to see if it still works and if you still get the newlines?
Checked out on your branch and installed it with pipx install .
But bug is still here
Do you have anything in the clipboard before you invoke rofimoji?
Yes
So, to recap, you start rofimoji with rofimoji -a clipboard. You type Alt+1 (for example) to paste your most recent character into some app. Does the character appear? And after that, a newline character is added?
Does it work for you now, @NikolaB131?
Since I got no more feedback, I'll close this issue. If something comes up again, feel free to re-open this.
So, to recap, you start
rofimojiwithrofimoji -a clipboard. You typeAlt+1(for example) to paste your most recent character into some app. Does the character appear? And after that, a newline character is added?
Sorry for long respond again :(
Yes i start rofinoji with rofimoji -a clipboard --selector rofi. Then select recent emoji with Alt+1, character is not appears, and if i try to paste something from my buffer with Ctrl+v, then it pastes what i copied earlier with newline symbol.
And if i try to select recent emoji for example 5 times, then in my buffer will be 5 newlines
Can you please try wl-copy 🤞 and see if it's now in the clipboard? What happens with wl-copy --primary 🤞?
Secondly, some more questions:
- Can you please confirm that you use Wayland?
- Do you use a clipboard manager?
- Is it only broken for recent characters, or for all?
wl-copy 🤞 - yes, its in clipboard and pastes correctly
wl-copy --primary 🤞 - nothing, clipboard stays same as it was before command
- Can you please confirm that you use Wayland? - yes, i am (hyprland)
- Do you use a clipboard manager? - no
- Is it only broken for recent characters, or for all? - only for recent, pasting with direct search + pressing enter works correctly every time
Could you please look into .local/share/rofimoji/recent and look at the files there? Is there something weird in them? Could you maybe even post them, if you feel comfortable sharing?
I have 1 file in this directory, containing this:
🐺
😮
😄
😀
🔥
🫥
🤑
🤯
👆
🥳
Seems like totally normal history
Yep, that does look good. My best guess is that the alt key interferes somehow. Unfortunately, there's no way to change it yet (see #218).
You could try if pressing alt+p works for the non-recent selection. That should use the same insertion method.
Yes, that's 100% something with interferes of alt key, because if i quickly enough unpress alt key after alt+1, then the correct emoji is printed. And even more, if i choose emoji not from recent with regular enter and then press alt, emoji will not be pasted
Hm, that makes it difficult to fix: --action clipboard works by simulating pressing shift + insert. If you "keep" alt pressed, though inadvertently, it's alt + shift + insert, which does nothing.
The only option for rofimoji would be to introduce a small delay before simulating the key presses, but that's a thin line between "it works" and "it's taking too long".
Yeah, I don't think idea with delay solve problem. Anyway, thanks for the tool!
I had one more idea how we could work around this. Could you please try the branch test/depress-alt and see if that works and/or behaves weirdly? Thank you 🙂
Just tested that branch, unfortunately, behavior does not change at all
Pity, but thanks for testing. Then I'm out of ideas. If you have any, please re-open the ticket.