I like having a keyboard shortcut to paste contents of X11 clipboard. Right now, I have the following in my .Xresources file:

XTerm*VT100*translations: #override \n\
    <Key>F2: insert-selection(PRIMARY,CUT_BUFFER0)

That makes the function key into a keyboard paste in an xterm window of whatever I've highlighted in some other xterm window. I like having keyboard paste a special key on my left hand, because that means I can move the mouse around with my right hand, and I don't have to move from mouse-to-keyboard-and-back with my right hand all the time.

Does some more general method of doing this exist? I'm stuck using explicit copy-n-paste (control-C, control-V) in Firefox, and I'd like to use to paste everywhere.

  • Probably I misunderstand you, but I find the mouse's middle button handier: with the left mouse button (right hand) I select the text in Firefox, with Alt-Tab (left hand) I switch the window to XTerm, with middle button (right hand) I paste the text into XTerm. Have I missed something in your workflow?
    – manatwork
    Jul 30 '12 at 17:15
  • Just a little. If I copy some text with a mouse, I often want to paste it while both hands are back on the keyboard, you know, like when editing with Vim. Or maybe I paste once with the middle-mouse-button, and then a few seconds later, I want to paste again, but both hands are on the keyboard. Jul 30 '12 at 18:50
  • Got it. Sorry, I have no idea that would better integrate into this workflow.
    – manatwork
    Jul 31 '12 at 5:54
  • Do any of the answers to these questions work?
    – jw013
    Aug 7 '12 at 14:35

You can map the execution of:

xte "mouseclick 2"

to some key or key combination in your window manager.

For instance, with openbox, add

<keybind key="S-F2">
    <action name="Execute">
      <command>xte "mouseclick 2"</command>

to the keyboard section to bind it to Shift-F2

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.