From ArchWiki
Revision as of 04:34, 26 June 2009 by Cdwillis (talk | contribs)
Jump to: navigation, search


rxvt-unicode is a highly customizable terminal emulator forked from rxvt. Commonly known as urxvt, rxvt-unicode can be daemonized to run clients within a single process in order to minimize the use of system resources. Developed by Marc Lehmann, some of the more outstanding features of rxvt-unicode include international language support through Unicode, the ability to display multiple font types and support for Perl extensions.

Package Installation

rxvt-unicode is part of the official Arch Linux (extra) repositories.

$ pacman -Si rxvt-unicode
Repository     : extra
Name           : rxvt-unicode
Version        : 9.06-1
URL            : http://software.schmorp.de/pkg/rxvt-unicode.html
Licenses       : GPL2  
Groups         : None
Provides       : None
Depends On     : gcc-libs  libxft  libxpm  
Optional Deps  : perl: lots of utilities
                 gtk-perl: to use the urxvt-tabbed
Conflicts With : None
Replaces       : None
Download Size  : 2312.19 K
Installed Size : 5208.00 K
Packager       : Tobias Kieslich [ tobias <funnychar> archlinux <dot> org ]
Architecture   : i686
Build Date     : Sat 08 Nov 2008 07:17:29 PM PST
MD5 Sum        : d731dc0fe3958eac340fc8ad54a95e51
Description    : an unicode enabled rxvt-clone terminal emulator (urxvt)

Install the latest version of rxvt-unicode:

# pacman -Sy rxvt-unicode


Creating ~/.Xdefaults

The look, feel and function of rxvt-unicode is typically controlled by way of either command-line arguments, or resource settings within the file ~/.Xdefaults. If ~/.Xdefaults is not present in the desired home directory, create one:

$ cd ~
$ touch .Xdefaults

All that is left at this point is to enter desired settings by editing the text-based .Xdefaults file.

Template:Box Note

Example .Xdefaults

URxvt.buffered: true
URxvt.background: black
URxvt.foreground: white
URxvt.cursorColor: green
URxvt.underlineColor: yellow
URxvt.font: xft:Terminus:pixelsize=14:antialias=false
URxvt.boldFont: xft:Terminus:bold:pixelsize=14:antialias=false
URxvt.perl-ext-common: default,tabbed
URxvt.title: ArchWiki Example

Improving Performance

  • Avoid the use of Xft fonts. If Xft fonts must be used, append :antialias=false to the setting value.[1]
  • Build rxvt-unicode with disabled support for unnecessary features, --disable-xft and --disable-unicode3 in particular.[2]
  • Limit the number of saveLines (option -sl) in the scrollback buffer to reduce memory usage.[3]
  • Consider running urxvtd as a daemon accepting connections from urxvtc clients.[4]

Troubleshooting DRAFT

Addtional Files Created

  • ~/.terminfo/r/rxvt-unicode
Terminfo library and database file.
  • ~/.rxvt-unicode-hostname
Socket connection file created by urxvtd.

Clickable URLs

You can make URLs in the terminal clickable if you have Perl installed. For example to open links in Firefox add the following to your .Xdefaults:

   URxvt.perl-ext-common : default,matcher
   URxvt.urlLauncher     : /usr/bin/firefox
   URxvt.matcher.button  : 1 

Cut (Selection) & Paste

For users unfamiliar with X11 data transfer methods, the exchange of information to and from rxvt-unicode can become a burden. Suffice to say that rxvt-unicode uses cut buffers which are typically loaded into the current PRIMARY selection by default.[1] Users are urged to review the Wikipedia article X Window Selection for additional information.

Clipboard Management

  • Parcellite is an actively developed GTK+ clipboard manager which can also run in the background as a daemon.
  • autocutsel provides command line and daemon interfaces to synchronize PRIMARY, CLIPBOARD and cut buffer selections.
  • Glipper is a GNOME panel applet with older versions available for use in environments other than GNOME.
  • Clipman (xfce-clipman-plugin) is a GUI clipboard manager plugin for the Xfce panel (xfpanel).

No clipboard management solution

Skottish[1] created a perl script to automatically copy any selection in urxvt to the X clipboard. You should create a file with the following content in /usr/lib/urxvt/perl named clipboard

#! /usr/bin/perl

sub on_sel_grab {
    my $query = quotemeta $_[0]->selection;
    $query =~ s/\n/\\n/g;
    $query =~ s/\r/\\r/g;
    system( "echo -en " . $query . " | xsel -ibp" );
It also requires xsel and needs to be enabled in the *perl-ext-common field in .Xdefaults. There should be a line in .Xdefaults that looks like this:
urxvt*perl-ext-common:      default,matcher,clipboard

Font Declaration Methods

URxvt.font: 9x15

is the same as



URxvt.font: 9x15bold

is the same as

URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1

Improved Kuake-like Behavior in Openbox

This was originally posted on the forum by Xyne[2] and it relies on "xdotool" which is available in the community repo.

The Scriptlets

Save this scriptlet from the urxvtc man page somewhere on your system as "urxvtc" (e.g. in ~/.config/openbox):

urxvtc "$@"
if [ $? -eq 2 ]; then
   urxvtd -q -o -f
   urxvtc "$@"

and save this one as "urxvtq":


wid=$(xdotool search --name urxvtq)
if [ -z "$wid" ]; then
  /path/to/urxvtc -name urxvtq -geometry 80x28
  wid=$(xdotool search --name urxvtq)
  xdotool windowfocus $wid
  xdotool key Control_L+l
  if [ -z "$(xdotool search --onlyvisible --name urxvtq 2>/dev/null)" ]; then
    xdotool windowmap $wid
    xdotool windowfocus $wid
    xdotool windowunmap $wid

Make sure that you change "/path/to/urxvtc" to the actual path to the urxvtc scriptlet that you saved above. We'll be using urxvtc to launch both regular instances of urxvt and the kuake-like instance.

Openbox Configuration

Now add the following lines to the "<applications>" section of ~/.config/openbox/rc.xml:

    <application name="urxvtq">
       <position force="yes">

and add these lines to the "<keyboard>" section:

    <keybind key="W-t">
      <action name="Execute">
    <keybind key="W-grave">
      <action name="Execute">

Here too you need to change the "/path/to/*" lines to point to the scripts that you saved above. Save the file and then reconfigure Openbox. You should now be able to launch regular instances of urxvt with the Windows/Super key and "t" and toggle the kuake-like console with Windows/Super+grave (`).

Further Configuration

The advantage of this configuration over the urxvt kuake perl script is that Openbox provides more keybinding options such as modifier keys. The kuake script hijacks an entire physical key regardless of any modifier combination. Review the Openbox bindings documentation for the full range or possibilities.

The Openbox per-app settings can be used to further configure the behavior of the kuake-like console (e.g. screen position, layer, etc). You may need to change the "geometry" parameter in the urxvtq scriptlet to adjust the height of the console.

Related Scripts

hbekel has posted a generalized version of the urxvtq here which can be used to toggle any application using xdotool

A script / program for opening url's with your keyboard instead of mouse with urxvt [3]

Additional Resources

[4] See man 1 urxvtd and man 1 urxvtc for additional information.