Use Mouse Buttons to Perform Copy / Paste in Ubuntu

Updated (3/4/2013): If you don't have Compiz, you may read this article first.

As a programmer, the ability perform copy and paste efficiently is vital to me. What can be more efficient than Ctrl+C and Ctrl+V -- you might ask. Well, they are very efficient if you are right-handed, but I am left-handed (or rather, ambidextrous). I prefer to use the mouse with my left hand.

Here's the problem: when I am using a mouse, how can I do copy and paste without my left hand leaving the mouse for the keyboard? The right-click-to-bring-up-the-context-menu-and-copy thing will not do -- in order to copy like that, I need to first right click to bring up the context menu, move the mouse cursor the "Copy" position in the context menu, click on it; to paste, I need to right click again to bring up the context menu, and move the mouse cursor to the "Paste" position, click on it. That's four clicks and two movements. I am not all satisfied. After some experiment, I come up with a little script that will allow me to perform copy and paste quickly on a mouse.

Continue reading