The Linux desktop has two paste buffers: One that operates via the usual Ctrl-C/Ctrl-V shortcuts, and a second that can be accessed by clicking the middle mouse button on a three button mouse, or by clicking the scrollwheel on a two button + scrollwheel mouse.
On my desktop PC I use this second paste buffer frequently, but unfortunately my laptops don’t have the equivalent of a middle mouse button on their touchpads. There is a middle mouse click emulation you can configure that works by clicking both left and right buttons together, and on my older laptops this works well enough. However newer laptops have buttons that are not discrete physical buttons but clickable corners of the touchpad itself, and I find it quite challenging to simultaneously press both corners.
I cobbled together a simple work-around using xdotool, a very slick utility that allows X11 emulation of keyboard and mouse activity.
sudo apt-get install xdotool
I put this script in ~/bin/middle-mouse:
#!/bin/bash xdotool mousedown --clearmodifiers 2 xdotool mouseup 2
Then I set the script up to be run with Ctrl-Alt-V to parallel Ctrl-V paste. In Ubuntu’s System Settings go to Keyboard, select the Shortcuts tab, and then pick Custom Shortcuts. Click the ‘+’ and fill out the dialog with the full path to the script, as shown below:
Then click where it says ‘Disabled’ to set the accelerator keys and hit Ctrl-Alt-V. Done!
The one quirk I’ve found in using this is with Firefox. For some reason it prepends whatever I paste with a greater-than sign. Anyone have an idea on how to fix that?
Source: FULL ARTICLE at Planet Ubuntu



