Copy/paste text in Urxvt (rxvt-unicode) using keyboard

This is generally a topic of discussion between new Urxvt users that how do you copy/paste text in Urxvt terminal emulator.  The forums and discussion boards are filled with hundreds of topics of this kind and the methods described there not always work for every user. So today I am posting the method which I am using for a long time, it always works for me and it is easier to use too.

1.     Install xclip:

Since I use Archlinux

#pacman -S xclip
For CentOS/RHEL users “xclip” is in RPMforge repository.
For Ubuntu/Debian users it is in your official repositories.

2.    Copy this perl script in your /usr/lib/urxvt/perl/ with the “clipboard” name :

#cp urxvtclip /usr/lib/urxvt/perl/clipboard
NOTE: If you are using a 64 bit operating system chances are that your perl library path may be /usr/lib64 instead of /usr/lib. So double check your path before proceeding.

3.     Now add these lines to your .Xdefaults or .Xresources (whatever you use) :


URxvt.keysym.Shift-Control-V: perl:clipboard:paste

URxvt.iso14755: False

URxvt.perl-ext-common: default,clipboard

The first line binds ^+shift+V to “clipboard” extension and the second line disables iso14755 mode. Look at the last line in the above code make sure that your .Xdefaults or .Xresources does not already contain URxvt.perl-ext-common  line. If it does then just add “clipboard” to it, copy rest of the lines and you are done.

Copying text :

To copy the text just select the text with mouse and it will automatically be copied to your clipboard then you can paste the text anywhere you want with Coltrol + V.

Pasting text :

To paste the text in URxvt simply use Control + Shift + V.

If you have any comment or suggestion let me know and leave a reply.

Advertisements

About Gaurav Trivedi

Gaurav Trivedi is a Gnu/Linux user, geek and technology enthusiast. He loves to play FPS games and traveling.
This entry was posted in HowTo`s and tagged , , , , , . Bookmark the permalink.

12 Responses to Copy/paste text in Urxvt (rxvt-unicode) using keyboard

  1. Ramdziana says:

    2016, it works like a charm. Thank you!

  2. Thank you for this, been trying forever for something simple, this totally works and is dead simple.

  3. NomreReal says:

    Thanks!

  4. Paul says:

    Thanks for this… One that actually works.

  5. andreasdl says:

    Thanks! finally one that works!

  6. Rebeka says:

    Really awesome ! Thank you very much 🙂

  7. This seems like a more mature version of the above Perl script: https://github.com/muennich/urxvt-perls

  8. Alexander says:

    Thank you so much!

  9. Jon says:

    Thanks for this.

    Copying from a rvxt-unicode terminal wasn’t working and now it does!

  10. Erna says:

    helpful! i love reading your articles, thanks for all.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s