rxvt-unicode/Tips and tricks

From ArchWiki

See rxvt-unicode for the main article.

Improved Kuake-like behavior in Openbox

This was originally posted on the forum by Xyne [1], and it relies on the xdotool package.


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 --classname urxvtq | head -1)
if [ -z "$wid" ]; then
  ''/path/to/urxvtc'' -name urxvtq -geometry 80x28
  wid=$(xdotool search --classname urxvtq | head -1)
  xdotool windowfocus "$wid"
  xdotool key Control_L+l
  if [ -z "$(xdotool search --onlyvisible --classname urxvtq 2>/dev/null)" ]; then
    xdotool windowmap "$wid"
    xdotool windowfocus "$wid"
    xdotool windowunmap "$wid"

Make both files executable.

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

urxvtq with tabbing

To activate tab support, you can either replace the fifth line of your urxvtq:

/path/to/urxvtc -name urxvtq -geometry 80x28


/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28

or replace this line of your ~/.Xresources file:

URxvt.perl-ext-common: default,matcher


URxvt.perl-ext-common: default,matcher,tabbed

Tab control

Key Description
Shift+Left Switch to the tab left of the current one
Shift+Right Switch to the tab right of the current one
Shift+Down Create a new tab

You can also use your mouse to switch the tabs by clicking the wished one and create a new tab by clicking on [NEW].

To close a tab just enter exit like you would to normally close a terminal.

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 Super+T, and toggle the kuake-like console with Super+` (the grave key also known as the backtick).

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

Improving performance

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


Warning: If the server crashes, all processes in the clients are terminated. For example, xkill and server resets/restarts will kill the urxvtd instance including all windows it has opened. See urxvtd(1) for details.


See the Examples section in urxvtd(1). This is the preferred option.


Note: Regular users cannot execute systemctl power commands (reboot, poweroff, etc) when logged in to a urxvt client/daemon setup which is started through systemd, as the client is not part of the session. For this reason starting urxvt through systemd is discouraged.

System service:

Description=RXVT-Unicode Daemon

ExecStart=/usr/bin/urxvtd -q -o


Pass the username when starting the service:


For a systemd/User service, place the following unit files in ~/.config/systemd/user:

Description=Urxvt Terminal Daemon

ExecStart=/usr/bin/urxvtd -o -q

Description=urxvt daemon (socket activation)
Documentation=man:urxvtd(1) man:urxvt(1)



Advanced tab management

Install the urxvt-tabbedexAUR package, then add the tabbedex value to the URxvt.perl-ext-common X resource in your ~/.Xresources:

URxvt.perl-ext-common: ...,tabbedex,...
Note: If you have previously used the tabbed Perl extension and have defined the tabbed value for the URxvt.perl-ext-common X resource, please remove the tabbed value first to avoid conflict with tabbedex.

By default, the "[NEW]" button (which is rarely used and usable only with the mouse) is disabled with tabbedex. You can reenable this feature by setting the new-button to true.

URxvt.tabbedex.new-button: true

Tabs can be named with Shift+Up (Enter to confirm, Escape to cancel).

The tabs bar is hidden when only one tab is present. If you want to always show the tabs bar:

URxvt.tabbedex.autohide: false

To prevent the last tab from closing Urxvt, enable the following resource:

URxvt.tabbedex.reopen-on-close: yes

To start a new tab or cycle through tabs, use the following user commands: tabbedex:(new|next|prev)_tab. Example of mappings:

URxvt.keysym.Control-t: perl:tabbedex:new_tab
URxvt.keysym.Control-Tab: perl:tabbedex:next_tab
URxvt.keysym.Control-Shift-Tab: perl:tabbedex:prev_tab

To define your own key bindings to rename a tab or move a tab to the right or to the left, use the following commands: tabbedex:move_tab_(left|right) and tabbedex:rename_tab. Example of mappings:

URxvt.keysym.Control-Shift-Left: perl:tabbedex:move_tab_left
URxvt.keysym.Control-Shift-Right: perl:tabbedex:move_tab_right
URxvt.keysym.Control-Shift-R: perl:tabbedex:rename_tab
Note: Redefining the keys used for the user commands will not disable the default mappings, you have to set the X resource no-tabbedex-keys for that:
URxvt.tabbedex.no-tabbedex-keys: true


True transparency

To use true transparency, you need to be using a window manager that supports compositing or a separate compositor.

From the command-line:

$ urxvt -depth 32 -bg rgba:3f00/3f00/3f00/dddd

Using the configuration file:

URxvt.depth: 32
URxvt.background: rgba:1111/1111/1111/dddd


URxvt.depth: 32
URxvt.background: [95]#000000

where '95' is the opacity level in percentage and '#000000' is the background color.

To use a color i.e. #302351 with the rgba:rrrr/gggg/bbbb/aaaa syntax it would be rgba:3000/2300/5100/ee00. "ee00" (the alpha value) to make it nicely transparent.

Note: To make these settings universal for all forms of URxvt, you may add a wildcard. For example, URxvt.depth would become URxvt*depth.

Native transparency

If there is no need for true transparency, or if compositing uses too many resources on your system, you can get transparency working in the following way:

! Xresources file

URxvt*inheritPixmap: true
URxvt*transparent: true
! URxvt*shading: 0 to 99 darkens, 101 to 200 lightens
URxvt*shading: 110

Using the URxvt*background setting exemplified above instead of URxvt*shading will also work.

Note: Avoid using shading if you have a URxvt.tintColor set. Use a different tintColor instead.

Set icon

Note: Because of a bug report (FS#34862) complaining that the rxvt-unicode package had too many dependencies, you must now install rxvt-unicode-pixbufAUR in order to use the icon option.

By default URxvt does not feature a taskbar icon. However, this can be easily changed by adding the following line to ~/.Xresources and pointing to the desired icon:

URxvt.iconFile:    /usr/share/icons/Clarity/scalable/apps/terminal.svg

Use urxvt as application launcher

urxvt can be used as a lightweight alternative to application launchers such as gmrun. Run urxvt with the following configuration to imitate look and behaviour of an application launcher or assign the command to a custom alias:

$ urxvt -geometry 80x3 -name 'bashrun' -e sh -c "/bin/bash -i -t"

Xterm escape sequences

It is possible for rxvt-unicode to mimic the Xterm escape sequences. These can be found for arbitrary key combinations by running cat -v inside xterm, then bound in urxvt using keysyms.

Take this word by word movement binding as an example:

!Xterm escapes, word by word movement
URxvt.keysym.Control-Left:    \033[1;5D
URxvt.keysym.Control-Right:    \033[1;5C

For more information, see ascii(7) and the keysym section of the urxvt(1) man page.

Bidirectional support

It is possible to add bidirectional support for languages like Hebrew or Arabic using the bidi extension.

Note: The font you are using should support your language. For example, for viewing Hebrew you should use a font like terminus.

Bell Command

It is possible to execute a shell command when the terminal rings the bell. The pre-packed bell-command extension needs to be enabled first in the ~/.Xresources file:

 URxvt.perl-ext-common: ...,bell-command,...

The following example will use ALSA's aplay command to play a .wav file:

 URxvt.bell-command: aplay /path/to/a/file.wav

The following example will use libcanberra's canberra-gtk-play command to play the bell sound of your current sound theme:

 URxvt.bell-command: canberra-gtk-play -i bell

And the next setting will pop a visual notification:

 URxvt.bell-command: notify-send "rxvt-unicode: bell!"
Note: Setting the bell-command option alone will not mute the buzzer in your computer, to do that take a look at the PC speaker article.

Xterm-like colors

urxvt uses the same colors as Xterm, except one. Add URxvt.color12: rgb:5c/5c/ff to ~/.Xresources to change this.

Launch rxvt-unicode with current working directory of another window

Basically, there are three possibilities to launch urxvt "from here": some sort of shell script, Perl extension, and xcwd.


Install xcwdAUR or xcwd-gitAUR, see the README for more information.

i3 example setup:

bindsym $mod+KP_Enter exec urxvt --chdir "`xcwd`"
Note: xcwd is not intended to work in urxvtd(1)/urxvtc(1) environment.