Use Mouse Buttons to Perform Copy / Paste in Linux (Updated)

Posted on March 4, 2013
Filed Under Linux | 6 Comments     

This is a following-up post for this post. In my previous post, I have discussed how to perform copy/paste quickly using mouse buttons. The setup requires Compiz. If you use Compiz as your window manager, great, you don't need to read this article. If you don't, you still have alternative.


  • xbindkeys
  • xdotool
  • x11-utils (if you want seamless copy/paste in terminal window)

If any of above is not installed, you can install them by

sudo apt-get install [packageName]


Add the following content to ~/xbindkeysrc. If the file does not exists, run xbindkeys -d > $HOME/testrc to generate a default configuration file.

"$HOME/scripts/auto/copy-paste.sh copy"

"$HOME/scripts/auto/copy-paste.sh paste"

Follow this guide to create a copy/paste script, and save the script to the location you specified in .xbindkeysrc.

Also, chnage b:6 and b:7 accordingly.

Restart xbindkeys

killall xbindkeys && xbindkeys

Why hadn't you use this at the first place?

I had imwheel installed in my system, which took precedence over xbindkeys on mouse buttons. Once imwheel was removed, I was able to get xbindkeys working with mouse buttons. I am putting this up for those who might need it.

I have recently switched to i3 WM, which in my opinion is better than AWESOME. By using i3 WM, I can no longer use Compiz as WM. xbindkeys does exactly what I need.




If you find this post useful, consider donating a few bucks to help the server running cost.

Go to Top

Subscribe to keep track of your comment.
6 Comments so far
  1. Janine June 3, 2013 12:42 am
    Wow! At last I got a blog from where I know how to really get useful
    facts regarding my study and knowledge.
  2. Keenan June 7, 2013 12:27 am
    Very quickly this website will be famous amid all blogging viewers, due to it's fastidious articles
  3. rackmount lcd monitor July 6, 2013 2:58 am
    I appreciate the efforts you are doing to make people knowledgeable about exploring the new technologies. This is really an interesting post to read and get knowledge.
  4. hdmi video splitter July 10, 2013 4:58 am
    One can easily copy and paste between multiple shell prompts through mouse, by this method. This will be very useful and makes it easy through mouse.
  5. Fat Burning Chef Reviews May 5, 2014 9:46 pm
    I'm a plugin developer for wordpress platforms.

    I've produced a plugin that should acquire web surfer's email addresses in your database without resorting to their intervention.
    I am also wanting to find beta testers since you happen to be
    getting significant ranges of potential customers, I'm planning on you and
    the blogs. You may be attracted?
  6. Awesm.zendesk.com May 17, 2014 1:34 am

    Code Central...

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)


If you want to post source code, please wrap it with <pre> </pre>, or it will break.
For quotations, please use <blockquote> </blockquote>

Subscribe to keep track of your comment.

To my beloved readers:
Please note that you may freely post comments here, but I will most likely not be able to reply to most them due to my current availability.

Code Central Special


  • Which one do you prefer?

    View Results

    Loading ... Loading ...