X resources

From Gentoo Wiki
Jump to:navigation Jump to:search

Also known as the ~/.Xresources file.


X resources are configuration options for X applications such as the rxvt-unicode terminal emulator. They can also be used for setting the cursor theme. X resources can be set in ~/.Xresources.

While most display managers will automatically load this configuration file on startup, it is possible to load the configuration manually by running:

user $xrdb ~/.Xresources

The xrdb command is provided by the x11-apps/xrdb package.


Configuration options in the ~/.Xresources file should respect the following component syntax:

name.Class.resource: value

In many options the Class component is not used.

Examples of existing configuration options:

  • Xcursor.theme: redglass
  • xscreensaver.Dialog.background: #111111


Comments start with an exclamation mark or with double slashes. For example:

! This is a comment

// This is also a comment

/* Multiline comments
are supported
as well */


It is possible to use ? and * wildcards to apply a single rule to multiple configuration options. The ? matches any single component. The * matches zero or more components. For example:

*background: #000000 - Set the given value to all programs/classes which contain a component named background.


Constants can be defined in the following way:

#define name value (for example #define black #000000).


The main ~/.Xresources file can be composed of multiple sub-files (e.g. on a per-application basis). The includes can be defined as:

#include "file_name"

Example of including application sub-files:

FILE ~/.Xresources
#include ".Xresources.d/urxvt"
#include ".Xresources.d/xft"

See also

External resources