cdown / clipmenu

Clipboard management using dmenu
MIT License
1.11k stars 90 forks source link

Paste directly from $CM_LAUNCHER #129

Closed stef204 closed 5 months ago

stef204 commented 4 years ago

Clipmenu 6.1.0

When I bring up the Clipmenu list of copied items in Rofi, select one item and the press enter nothing happens.. This is a giant PITA (to me.)

Crtl+V and Shift-Insert both work but that is not how I want to use it. I should be able to select an item on the list and just hit enter for it to be pasted wherever cursor is (or "current window".)

What am I doing wrong?

cdown commented 4 years ago

That's simply not how clipmenu works, or has ever worked :-)

But other than that, this is a dupe of #125

cdown commented 4 years ago

Oh wait, #125 is misleadingly titled, so let's keep this separate.

But yeah, this has never been a feature clipmenu offered. Patches are welcome, though :-)

Since I've not had any PR for it in over 5 years of clipmenu, I'm going to guess it's not something that's widely desirable, so it should be off by default.

stef204 commented 4 years ago

I don't understand why you think if should be "off" by default. How can one beat the ease of use and flow of 1) selecting an item and 2) pasting an item by just using enter?

That is how it should work.

How can I make it work in this fashion currently? && xdotool key shift+Insert does not seem to work for me.

Got it to work now.

And I had missed #125 (as you mentioned, title did not bring focus to the issue but it is indeed the same problem , it seems.)

Using i3 if that helps,

cdown commented 4 years ago

I don't understand why you think if should be "off" by default. How can one beat the ease of use and flow of 1) selecting an item and 2) pasting an item by just using enter?

That is how it should work.

Your assertiveness that that is how it should work is not matched by the lack of demand from existing clipmenu users.

I do not ever want a paste to happen without an explicit insertion, since there are many reasons focus could change and have the output pasted to the wrong window (dialog windows, X11 urgent hint, WM decisions about focus passing after dmenu, etc...). If that's something sensitive, that's a disaster, and there's no way we're going to have that on by default.

And second of all, there are plenty of things I want to select but do not want to immediately paste, regardless.

Sorry, but having it anything other than off by default is a non-starter.

stef204 commented 4 years ago

I totally see your point and agree with it. It's very sensitive and you could end up pasting your password on a webpage if focus changes to it from another window you wanted to paste into.

But is that not managed by just being focused on the window you intend to paste in in the first place?

I'll try it this way and if I run into trouble will remove the xdotool.

To stay on the practical side, how does one achieve the 'select and paste in one shot' (by pressing enter) other than using the xdotool trick?

Or that's just not a feature at all and no plans to make it optional?

cdown commented 4 years ago

But is that not managed by just being focused on the window you intend to paste in in the first place?

No, because typically $CM_LAUNCHER grabs focus with XSetInputFocus/XRaiseWindow, and it's up to the window manager how it puts it back, whereas this doesn't happen with the "normal" paste case.

To stay on the practical side, how does one achieve the 'select and paste in one shot' (by pressing enter) other than using the xdotool trick?

Or that's just not a feature at all and no plans to make it optional?

To repeat my reply above: I'll be happy to merge a patch which implements this, as long as it's off by default.

mil-ad commented 4 years ago

@stef204 I have created PR #137 to do the paste via xdotool

wwalker commented 3 years ago

I wrote my own tool (2 lines) to do what @stef204 is asking for. Because not all tools accept Cntl-V (or Shift-Insert, or middle mouse click), I mas my tool type the output instead of pasting the output.

I thought it was great, until I selected a 50 line selection. It started typeing and I looked at a different window, and moved focus there .... and part of the 60 line selection was run at the terminal!! Fortunately, there was no dangerous commands in the selection, but there could have been.

I'm also often bit by some popup stealing focus. But having said that I'll try to provide a patch (off be default).

cdown commented 5 months ago

Closing since I don't think it's likely this is going to happen, especially with migration away from using shell tooling. If you must have it, you can always do it just by having a script that runs xdotool after clipmenu has finished.