Adding Copy & Paste to URXVT terminal

When I migrated to Arch Linux and using the Awesome window manager I also adopted the famed urxvt terminal. This terminal is very configurable but doesn’t come with good defaults. In the case of this log specifically it is missing the ability to copy and paste into the terminal. I found a guide here that I’ll summarize below.

#Install xclip from arch repos
$ pacman -S xclip

Download and extract this perl script to /usr/lib/urxvt/perl with the name clipboard

$ wget -0 urxvtclip.tar.gz http://db.tt/JjlLYd5A
$ tar -xzvf urxvtclip.tar.gz
# I run 64-bit system. You may find per under /usr/lib for 32-bit
$ cp urxvtclip /usr/lib64/urxvt/perl/clipboard

Next I needed to add a few lines to my .Xdefaults. The reference tutorial states that this is also valid for .Xresources.

! Copy and paste settings
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.iso14755: False
URxvt.perl-ext-common: default,clipboard

When I inspected my .Xdefaults URxvt.perl-ext-common: ... already existed so I simply appended clipboard to the comma separated list.

Restart your terminal and you have access to the new functionality. Highlighted text in the terminal is now automatically added to the clipboard. You can paste into the urxvt terminal using ctrl + shift + v.

Published: September 27 2014

blog comments powered by Disqus