Sunday, March 18, 2012

urxvt: looking better and with tabs

urxvt is a great terminal emulator, but I don't particularly care for it's default look and feel. It's not very difficult to make it look better though.

This page explains how you can make urxvt look like gnome-terminal by adding a few lines to your .Xdefaults file. This is how my .Xdefaults looks like:
URxvt*background: #000000
URxvt*foreground: #00ff00
! black
URxvt.color0  : #000000
URxvt.color8  : #555555
! red
URxvt.color1  : #AA0000
URxvt.color9  : #FF5555
! green
URxvt.color2  : #00AA00
URxvt.color10 : #55FF55
! yellow
URxvt.color3  : #AA5500
URxvt.color11 : #FFFF55
! blue
URxvt.color4  : #0000AA
URxvt.color12 : #5555FF
! magenta
URxvt.color5  : #AA00AA
URxvt.color13 : #FF55FF
! cyan
URxvt.color6  : #00AAAA
URxvt.color14 : #55FFFF
! white
URxvt.color7  : #AAAAAA
URxvt.color15 : #FFFFFF

URxvt*font: xft:Monospace:pixelsize=18

URxvt*letterSpace: -1

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


! scrollbar style - rxvt (default), plain (most compact), next, or xterm
URxvt.scrollstyle: plain

URxvt.perl-ext-common:  default,tabbed
Also, if you like to have tabs, you can run urxvt like urxvt -pe tabbed, or you can add this line to your .Xdefaults.
URxvt.perl-ext-common:  default,tabbed
 In order to open a new tab, press C-M-Down (that is, control and alt and down arrow). To switch tabs use C-M-Left and C-M-Right. To move the current tab, use C-Left and C-Right. I wish I could change these key bindings since the arrow keys are two far away from my comfort zone, but I haven't find a way to do that, yet. Well, nothing is perfect!

For more urxvt customizations, see this page.

By the way, this is the commands I've put in my .stumpwmrc in order to have urxvt as my default terminal emulator. Notice that the class attribute is URxvt not Urxvt as one might expect.
(defcommand urxvt () ()
  "Start a urxvt instance or switch to it if already running"
  (run-or-raise "urxvt" '(:class "URxvt")))
(define-key *root-map* (kbd "c") "urxvt")
(define-key *root-map* (kbd "C-c") "urxvt")
 If you're ever in doubt about the class attribute of a certain window, just switch to it, press C-t : and then type in (stumpwm::window-class (stumpwm::current-window)).

No comments:

Post a Comment

Better Console Font (in Arch)

In order to use Terminus as my console (tty) font, I simply installed the package terminus-font with pacman (includes both console and X11 ...