Sunday, April 30, 2017

Pasting from X selection with keyboard

My mouse's middle button has a problem after I have been using it for a few years. It doesn't easily work when I click it to paste anymore. I have to try clicking the button a few times each time and that is very sad, and it even hurts my hand already. It's time to paste with keyboard instead.

I learn from Google Search that "shift+ins" works. I have tried that with Ubuntu 14.04 (Unity) and Debian (lxde). It works, but not for all cases. Now, I am using a workaround below instead:

xsel | xclip -selection c

It passes the text I select to clipboard and then I can use ctrl+v to paste instead. The bad thing is that it trashes whatever is stored in the clipboard (ctrl+c). But it is reliable. Feel free to map it with other tools at your convenience.

No comments:

Post a Comment