Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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>
  </action>
</keybind>

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.

share|improve this question

2 Answers 2

up vote 2 down vote accepted
  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!

share|improve this answer

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

Enjoy!

share|improve this answer
    
Interesting, thanks for the tip :) –  zarnaik Nov 17 '13 at 14:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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