Hi all,

As I wrote in my last post I have recently reinstalled my laptop and I made made the switch from Konsole to urxvt. I’ve been using i3wm for a while and still using Konsole as my terminal emulator didn’t feel like it fit in well with i3wm. There was nothing really “wrong” with it, just didn’t feel right so I switched to urxvt.

First of all, urxvt looks quite hidious by default but that can be fixed. I found this somewhere in the internet, credits go to original poster but I can’t remember where I found it.

In your .Xdefaults file;

urxvt*foreground: white
urxvt*background: black
urxvt*scrollBar: false

Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintfull

URxvt.font: xft:Monospace:pixelsize=12
URxvt.boldfont: xft:Monospace-Bold:pixelsize=12

*color0: #2E3436
*color1: #a40000
*color2: #4E9A06
*color3: #C4A000
*color4: #3465A4
*color5: #75507B
*color6: #ce5c00
*color7: #babdb9
*color8: #555753
*color9: #EF2929
*color10: #8AE234
*color11: #FCE94F
*color12: #729FCF
*color13: #AD7FA8
*color14: #fcaf3e
*color15: #EEEEE

You can ofcourse tweak this to your liking. Just close the current window and open urxvt again, settings will be instantly activated.

But… that is not what this article is about. Urxvt has the nasty habit of, by default, not supporting clipboard pasting using Ctrl-Shift-V. Even though there may be different ways to do this, this is the way I’ve been doing it for a long… long time now and I simply like it to be the way it was. I have been searching for this for quite a while until I stumled upon a post by posting exacyly what I needed. It’s fairly simple.

Create a file in /usr/lib64/urxvt/perl/clipboard (note that I’m placing this in lib64, not lib) and paste the following code in it;

#script to copy/paste text in URXVT

#! perl

sub on_sel_grab {
    my $query = $_[0]->selection;
    open (my $pipe,'| /usr/bin/xclip -in -selection clipboard') or die;
    print $pipe $query;
    close $pipe;

sub paste {
    my ($self) = @_;
    my $content = `/usr/bin/xclip -loop 1 -out -selection clipboard` ;
    $self->tt_write ($content);

sub on_user_command {
    my ($self, $cmd) = @_;
    if ($cmd eq "clipboard:paste") {

Now, this needs xclip. In Fedora you can simply install this using yum;

yum install -y xclip

Then append the following lines to your .Xdefaults;

# Enable the ability to use regular copy-paste
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.iso14755: False
URxvt.perl-ext-common: default,clipboard

And you’re all set (after restarting urxvf ofcourse)! Everything you select is automatically copied to your clipboard, you can paste it using Ctrl+Shift+V.

Copy paste using Ctrl+Shift+V in urxvt