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.
Prerequisites
- 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]
~/xbindkeysrc
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"
b:6
"$HOME/scripts/auto/copy-paste.sh paste"
b:7
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.
References
https://help.ubuntu.com/community/KeyboardShortcuts
https://wiki.archlinux.org/index.php/Xbindkeys
Leave a Comment
If you would like to make a comment, please fill out the form below.
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.
