I am aware that mouse selection and CTRL+C adds content to the PRIMARY and CLIPBOARD X Selections but I need a keyboard shortcut(or mouse) to have the selected text in SECONDARY Selection.

Any leads would be very helpful.

  • 1
    Actually no. I don't want the primary content to be just copied to secondary. I am in need of a clipboard which isn't often used or isn't disturbed with normal copy/paste keys. Hence, I think that a keyboard shortcut to copy to the SECONDARY selection would solve the problem. If there is any other way to achieve the same goal without manually adding shortcut keys then I would be very pleased to hear that. – user2730066 May 1 '16 at 19:20
  • 2
    So ... xsel -o | xsel -s or xsel -o | xclip -i selection secondary ? – Runium May 1 '16 at 19:43
  • I am sorry but I don't understand how this solves the problem. – user2730066 May 1 '16 at 19:53
  • This is something I made. It makes your clipboard content accessible to others on the network. But the usual ctrl+c makes the list messy and useless. I want only certain selections to be made public and I want the user to choose those selections. Now, if just copy the primary selection to secondary selection, the list still gets the usual useless text from ctrl+c. So, what I am looking for is a <combo> which when pressed, activates the SECONDARY Selection and the user's public list gets updated with only those selections. – user2730066 May 1 '16 at 20:11
  • 1
    I actually needed it to mostly work on chrome/firefox but thanks for byobu. – user2730066 May 2 '16 at 5:51

It's impossible to define such a shortcut unless the application supports it. The notion of selected text is entirely within the application, there's no way to access it from the outside, and there's no way to ask the application for the selected text (except by using some application-specific protocol).

Many applications automatically copy the selected text to the primary selection — that's how the primary selection is supposed to be used (but, once again, this is a convention, not a system feature). Hence the suggestion to have a shortcut that copies the primary selection to the secondary selection, e.g. with xsel -o | xsel -s.

  • 1
    Thank you for clearing things out. And I think creating a key board shortcut like ctrl+alt+c for doing xsel -o | xsel -s could help a bit. – user2730066 May 2 '16 at 5:48

I'm not aware of any secondary clipboard (other than having Clipman running — I use Xfce4). What I often do is select text and paste with the middle-click mouse button.

Whenever I need two simultaneous (and convenient) copy/paste paths I select some text, either with the keyboard or mouse, press Ctrl + C, select some other text then use the middle click button and Ctrl + V shortcut whenever appropriate. The order doesn't matter as long as I don't select anything.

Many applications do move the pointer where the middle click occurs. This makes aim/paste simultaneous.

  • This is what I mean when I say SECONDARY selection. And although that is a neat trick, I still need a way to use SECONDARY selection directly through a keyboard shortcut. – user2730066 May 1 '16 at 20:28
  • Reading that page makes me wonder if it's possible at all. I really have no clue. – user86969 May 1 '16 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.