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

ENTER or CTRL+N doesn't paste, but puts the element as the last copied. #27

Closed
ivan-toriya opened this issue Aug 17, 2024 · 8 comments
Closed

Comments

@ivan-toriya
Copy link

OS: Debian 12
DE: GNOME 43.9, wayland

How to reproduce?

  1. Place the cursor where you want to paste.
  2. Open the Ringboard egui.
  3. Select the entry that you want to paste and press ENTER (or just select with CTRL+N)
  4. Nothing happens.
  5. Press CTRL+V, the selected entry at step 3 get pasted.

I don't understand if it's intended behavior or a bug. I would like the entry to be pasted at step 3 directly. If it's intended behavior, the docs should be edited.

@jacobcheatley
Copy link

Can confirm I have the same behaviour.

OS: Ubuntu 24.04
DE: Gnome 46.0, X11

Installation Method/Setup
Is as recommended by the automatic installation in the main README.

  1. Install cargo
  2. rustup install nightly # If not already installed
  3. curl -s https://raw.githubusercontent.com/SUPERCILEX/clipboard-history/master/install-with-cargo-systemd.sh | bash
  4. bash -c 'echo sh -c \"ps -p \`cat /tmp/.ringboard/$USERNAME.egui-sleep 2\> /dev/null\` \> /dev/null 2\>\&1 \&\& exec rm -f /tmp/.ringboard/$USERNAME.egui-sleep \|\| exec $(which ringboard-egui)\"'
    • This produced sh -c "ps -p `cat /tmp/.ringboard/jacob.egui-sleep 2> /dev/null` > /dev/null 2>&1 && exec rm -f /tmp/.ringboard/jacob.egui-sleep || exec /home/jacob/.cargo/bin/ringboard-egui"
  5. Created a custom shortcut with the produced command
    image

And reproduction notes the same as above, though I want to specify that instead of nothing happening after step 3 for me, the ringboard GUI closes and then the active window becomes whatever the active window was before the GUI was opened (with nothing directly pasted in - that's the unexpected part!).

@SUPERCILEX
Copy link
Owner

The current behavior works as the code is written, but it would be nice to eventually auto-paste for you. The problem is that there's no such thing as "please paste." A window has to actively seek to read the clipboard and AFAIK there's no standard to trigger a paste. So the hacky way around it is to send keyboard events simulating a user typing a paste. I had tried this and couldn't get it to work 100%, but I think I'll throw it up under a config.

@SUPERCILEX
Copy link
Owner

Ok, this is implemented but might still be a little buggy. You guys can install the dev version by running:

git clone https://github.com/SUPERCILEX/clipboard-history.git
cd clipboard-history
cargo install --path x11 --debug --no-default-features

Let me know if it ever fails to paste.

@jacobcheatley
Copy link

Oh wow, thank you, that was very quick! And seems to be working without issues in all the applications I quickly tested (i.e. Chrome, VSCode, gedit, gnome-terminal). Much better than my not-quite-working attempt at a workaround I made yesterday with xdotool

@SUPERCILEX
Copy link
Owner

Woohoo! That's great to hear. I'm going to let it bake on my machine a bit more, but I'll make an official release in like a week or two.

@SUPERCILEX
Copy link
Owner

Released! https://github.com/SUPERCILEX/clipboard-history/releases/tag/0.6.0

@ivan-toriya
Copy link
Author

It only works with X11, right?

@SUPERCILEX
Copy link
Owner

I'm not sure. It might work in Wayland, but that hasn't been tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants