I was wondering if it is possible to add a keybind to paste the x-clipboard in Lubuntu. (primary selection)

If possible to keybind it, would you still be able to use the middle-click too? Is there perhaps a clipboard manager that supports this?

Thanks in advance, Zarnaik

Edit: Thanks to Kupiakos for providing a solution. I have not tested it in Ubuntu, Lubuntu only.

This is how I did it.
First run

sudo apt-get install xsel xvkbd

to install the necessary packages. Then open the openbox configuration file as so

gedit ~/.config/openbox/lubuntu-rc.xml

replacing gedit by whatever text-editor you use.

Once inside the file look for the <keyboard> tag and add the below code.

<keybind key="W-v">
  <action name="Execute">
<command>sh -c 'xsel | xvkbd -xsendevent -file -'</command>

I configured it to work with Super + v, but you can easily adjust that. Save the file and make openbox notice the change by executing

openbox --reconfigure

That's all there is to it.

Again thanks to Kupiakos for providing the command that I still fail to understand.

  1. Run this command to install the necessary X utilities: sudo apt-get install xsel xvkbd

  2. Navigate to the Shortcuts section of the Keyboard Settings in System Settings.

  3. Create a new custom shortcut. Put whatever you want in the Name field.

  4. In the Command field, put this: sh -c 'xsel | xvkbd -xsendevent -file -'.

  5. Click Apply.

  6. Click on the far right of the new row you created (where it says Disabled) and set the new keyboard shortcut.

  7. Try it out!


I found a cool solution as well. You can use something called xdotool to type C-V for you. Just bind your new paste key using whichever method you like (xbindkeys, openbox rc, etc) to the following script:

xdotool keydown Control key V keyup Control


  • This can be pretty useful but it bothers me it doesn't work for pasting into a terminal (I had something similar bound to a hotkey) – joelnb Dec 22 '16 at 19:45

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.