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

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


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

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

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

Restart 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.


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

  1. Pingback: Use Mouse Buttons to Perform Copy / Paste in Ubuntu | Code Central

Comments are closed.