rofi icon indicating copy to clipboard operation
rofi copied to clipboard

Provide keybindings to copy entries to the clipboard

Open blueyed opened this issue 8 years ago • 6 comments

I would be useful if you could copy a selected entry as through a generic keybinding.

Ctrl-c to copy it to the clipboard might be enough, not sure about (and what to use for) the primary selection (<Shift-Delete>?!)

Ref: https://github.com/DaveDavenport/rofi/issues/174#issuecomment-207464443

blueyed avatar Apr 08 '16 16:04 blueyed

Personally I'd like to see this as CtrlShiftC if only because that's how I copy from my terminal (most VTE based like gnome-terminal/etc) and odds are if I'm copying a command to further edit I'm going to be pasting it into a terminal with the corresponding CtrlShiftV.

dragon788 avatar Dec 23 '17 05:12 dragon788

This would be pretty cool. @DaveDavenport your thoughts on this? If you don't think it'd be good to have this in rofi, I'd have to implement it just for my plugin.

svenstaro avatar May 20 '18 11:05 svenstaro

Patch is welcome. Never got around implementing it because I was unsure if possible as normally (if I understand correctly) there needs to be an 'owner' of the clipboard content, and if rofi is closed.....

DaveDavenport avatar May 20 '18 14:05 DaveDavenport

If you could bind an action to a keypress within rofi you could have it pipe out to xsel or xclip or pbcopy and not have to manage the clipboard within rofi itself. That would be more in keeping with the Unix philosophy.

dragon788 avatar May 20 '18 16:05 dragon788

my experience (at least from memory) of clipboard ownership is that it varies from one application to the next. in general, my "feeling" is that the primary selection (text that is just selected with the left mouse button and pasted with the middle mouse button) goes away when the process dies, but that CLIPBOARD (control-c) selections survive processes. xclip treats both equally and forks in the background to service the selection requests, exiting when it detect something else is responsible.

but the specification actually says that:

If a client needs to exit while owning the CLIPBOARD selection, it should request the clipboard manager to take over the ownership of the clipboard, using the SAVE_TARGETS mechanism. If there is no clipboard manager, or if the SAVE_TARGETS conversion fails, the application should simply exit.

In other words, there is a way to save clipboard contents outside of the application when we exit, so it should be possible to implement clipboard support without reverting to hacks involving xclip.

anarcat avatar May 26 '18 14:05 anarcat

This would be a "feature" for me. I regularly used my previous launcher as a quick and dirty pastebin to strip rich formatting from text I grab from websites before adding it to an email. I find it hard to shake this habit! It would be great if you get around to it. 😀🙏🏻 Thanks for a great program and keep up the good work

robole avatar May 28 '21 09:05 robole

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 23 '22 00:09 github-actions[bot]