xterm & URxvt – make ’em look nicer

If you are interested in small footprint, low resource use terminals, there are few skinnier than xterm and URxvt.  The ‘thing’ that scares most people away from these tiny terminals is out of the box they are both ugly and follow some non-conventional approaches. Here’s a list of the xterm & URxvt ‘vanilla version’ downsides (my opinion):

  • Yuck! they are ugly.
  • Neither uses ctrl-shift-c (cut) & ctrl-shift-v (paste).
  • Text spacing within the terminal frame is too squished on the edge.
  • The basic terminal window size  is unbelievably tiny and unusable on a modern screen.
  • The base fonts and bible print size (tinyyyy) and grainy.
  • Both lack transparency.  xterm is not really easily fixable with respect to transparency, but URxvt is fixable (see below code snippet).

Here is a scrot of my terminals (xcompmgr is running for URxvt transparency).

xterm-left ~ URxvt-right on dwm with xcompmgr

 

FWIW: I tend to use xterm these days, I don’t run a compositor. I find screens are easier on my old eyes without transparency.

What follows are the way(s) I fix them.  All the ‘fixes’ are contained within my .Xresources file. There are no code patches, such as are required for st (suckless terminal). Simply add the below “snippet” to your .Xresources file in $Home, Logout & Login. If you have installed:

  • a compositor like xcompgr or picom/compton (If not, you will need one to run in order to get transparency on URxvt.)
  • xterm and/or URxvt and things should work.

Below is my code snippet (Note: the colors I use are from the Nordic Theme; replace them with your favorite color scheme.)

! Nordic Color scheme
#define nord0 #2E3440
#define nord1 #3B4252
#define nord2 #434C5E
#define nord3 #4C566A
#define nord4 #D8DEE9
#define nord5 #E5E9F0
#define nord6 #ECEFF4
#define nord7 #8FBCBB
#define nord8 #88C0D0
#define nord9 #81A1C1
#define nord10 #5E81AC
#define nord11 #BF616A
#define nord12 #D08770
#define nord13 #EBCB8B
#define nord14 #A3BE8C
#define nord15 #B48EAD

*.foreground:   nord4
*.background:   nord0
*.cursorColor:  nord4
*fading: 35
*fadeColor: nord3

*.color0: nord1
*.color1: nord11
*.color2: nord14
*.color3: nord13
*.color4: nord9
*.color5: nord15
*.color6: nord8
*.color7: nord5
*.color8: nord3
*.color9: nord11
*.color10: nord14
*.color11: nord13
*.color12: nord9
*.color13: nord15
*.color14: nord7
*.color15: nord6

! URxvt Settings
URxvt.font:     xft:DejaVu Sans Mono:size=11.5:antialias=true
URxvt.boldFont: xft:DejaVu Sans Mono:bold:size=11.5:antialias=true
urxvt*scrollBar:                  false
urxvt*mouseWheelScrollPage:       true
urxvt*cursorBlink:                true
urxvt*saveLines:                  5000
urxvt*internalBorder: 15
urxvt*geometry: 90x32
! Setting transparency and background                                                                                                                                       
 URxvt*depth:      32                                                                                                                                                        
 URxvt.background: [85]#1A1C1E   

! Normal copy-paste keybindings  ( ctrl-shift c/v )
urxvt.iso14755:                   false
urxvt.keysym.Shift-Control-V:     eval:paste_clipboard
urxvt.keysym.Shift-Control-C:     eval:selection_to_clipboard
!xterm escape codes, word by word movement
urxvt.keysym.Control-Left:        \033[1;5D
urxvt.keysym.Shift-Control-Left:  \033[1;6D
urxvt.keysym.Control-Right:       \033[1;5C
urxvt.keysym.Shift-Control-Right: \033[1;6C
urxvt.keysym.Control-Up:          \033[1;5A
urxvt.keysym.Shift-Control-Up:    \033[1;6A
urxvt.keysym.Control-Down:        \033[1;5B
urxvt.keysym.Shift-Control-Down:  \033[1;6B

! Xterm Settings
xterm*font:     xft:DejaVu Sans Mono:size=11.5:antialias=true
xterm*geometry: 90x32
xterm*mouseWheelScrollPage:       true
xterm*cursorBlink:                true
xterm*saveLines:                  5000
xterm*internalBorder: 15
! Normal cut & paste key conventions ( ctrl-shift c/v )
XTerm*selectToClipboard:          true
XTerm*VT100.Translations: #override \
      Shift Ctrl<Key>C: copy-selection(CLIPBOARD) \n\
      Shift Ctrl<Key>V: insert-selection(CLIPBOARD) \n\ 
      Shift Ctrl<Key>V: insert-selection(PRIMARY) \n\ 
      Shift<Btn1Down>: select-start() \n\ 
      Shift<Btn1Motion>: select-extend() \n\ 
      Shift<Btn1Up>: select-end(CLIPBOARD) \n\

Remember, like with all of my work, I am able to provide the following assurance(s):
  • It is almost certainly going to work until it breaks; although I have to admit it may never work and that would be sad.
  • When/if it does break, you may keep all of the pieces.
  • If you find my materials helpful, both you & I will be happy, at least for a little while.
  • My advice is worth every penny you paid for it!