hluk / copyq-commands

Useful commands for CopyQ clipboard manager.
338 stars 73 forks source link

Use ctrl+ins instead of ctrl+c, for wayland copy command? #92

Closed pallaswept closed 6 months ago

pallaswept commented 8 months ago

I was just passing by for another reason, and I happened to notice in #89 you mentioned something. I didn't want to hijack that issue so I thought I should make another one.

The default copy() override for Wayland Support uses the following command:

ydotool key 29:1 46:1 46:0 29:0

This sends Ctrl+C shortcut so if run it in terminal it will send interrupt signal on the command line (the Ctrl+C shortcut - see the ^C in your output) which causes the ydotool not to send final key release events to the system so you end up with Ctrl in "pressed" state.

When I saw this, it occurred to me - what if we were to use

ydotool key 29:1 110:1 110:0 29:0

To send ctrl+ins as the replacement copy command? I guess it probably should work for most things, and also, it would be terminal-friendly? But I have a feeling you will already have considered this and have chosen ctrl+c for a good reason I haven't thought of yet :smiley: Anyway, I thought maybe this might be helpful.

hluk commented 6 months ago

I tested Ctrl+Insert in Konsole and Kitty and it does not copy the selection into clipboard. Thought Ctrl+C is still probably worse in terminal not sure what majority of the apps support.

Feel free to create a pull request if you thing another solution is better.