Customizing xterm in i3 on Arch Linux

Installing xterm

After a base i3-wm setup, the simplest terminal to drop in is xterm. Its the reference terminal for the X Window System, available in every repository and weighing only a few megabytes.

sudo pacman -S xterm

No exttra i3 configuration is required. The default key binding Mod1+Return already executes i3-sensible-terminal, and xterm is the first program that script tries to launch. If you prefer a different emulator, comment the default line and add your own:

# bindsym Mod1+Return exec i3-sensible-terminal
bindsym Mod1+Return exec alacritty

First steps with xterm under i3

  • Open a new terminal: Mod+Enter
  • Close the focused window: Mod+Shift+q

Copy and paste work out of the box with the PRIMARY selection:

  • Select text with the left mouse button → PRIMARY buffer
  • Middle-click anywhere → paste PRIMARY

Polishing the look with ~/.Xresources

X applications read resources from ~/.Xresources (or ~/.Xdefaults). The general syntax is:

name.Class.resource: value

Wildcards are allowed:

*background: #1E1E1E
*foreground: #EFEFEF

Comments start with !; additional files can be pulled in with #include.

Minimal xterm theme

! Appearance
xterm*background: #1E1E1E
xterm*foreground: #EFEFEF

! Font
xterm*faceName: Cascadia Code
xterm*faceSize: 12

Install the font first:

sudo pacman -S otf-cascadia-code

Merge the file into the X resource database and make it permanent:

xrdb -merge ~/.Xresources

Add to ~/.xinitrc before the final exec i3:

[ -f "$HOME/.Xresources" ] && xrdb -merge "$HOME/.Xresources"
exec i3

Clipboard integration inside VirtualBox

When running Arch as a VirtualBox guest, bidirectional clipboard support needs two extra steps.

  1. Install guest additions and start the service: ``` sudo pacman -S virtualbox-guest-utils sudo systemctl enable --now vboxservice
  2. Enable CLIPBOARD selection in xterm: ``` xterm*selectToClipboard: true
  3. Expose the clipboard to the host: ``` VBoxClient --clipboard
    
    

To avoid typing the last command on every login, add keyboard shortcuts for explicit copy/paste and let XDG Autostart handle the rest.

! ~/.Xresources additions
xterm.VT100.translations: #override \
    Shift Ctrl <Key>C: copy-selection(CLIPBOARD) \n\
    Shift Ctrl <Key>V: insert-selection(CLIPBOARD)

XDG Autostart with dex

i3 itself does not parse .desktop files, but the default configuration already ships:

exec --no-startup-id dex --autostart --environment i3

Install dex and drop a file into ~/.config/autostart/:

sudo pacman -S dex
$ cat ~/.config/autostart/vbox-clipboard.desktop
[Desktop Entry]
Type=Application
Name=VirtualBox Clipboard
Exec=VBoxClient --clipboard
X-GNOME-Autostart-enabled=true

Log out and back in; the clipboard daemon will now start automatically with every i3 session.

Complete ~/.Xresources

xterm*background: #1E1E1E
xterm*foreground: #EFEFEF
xterm*faceName: Cascadia Code
xterm*faceSize: 12
xterm*selectToClipboard: true
xterm.VT100.translations: #override \
    Shift Ctrl <Key>C: copy-selection(CLIPBOARD) \n\
    Shift Ctrl <Key>V: insert-selection(CLIPBOARD)

Tags: xterm i3-wm Arch Linux Xresources VirtualBox

Posted on Thu, 14 May 2026 19:41:50 +0000 by amotaz