xterm background colour

I'm trying to set the default background colour in xterm() to black and the man page mentions:-
/usr/local/lib/X11/app-defaults/XTerm-color
the xterm color application resources. If your display supports
color, use this
*customization: -color
in your .Xdefaults file to automatically use this resource file
rather than /usr/local/lib/X11/app-defaults/XTerm. If you do not
do this, xterm uses its compiled-in default resource settings for
colors.

/usr/local/lib/X11/app-defaults/XTerm-color contains:-
Code:
! Uncomment this for "white" text on a dark background.
!*VT100*foreground: gray90
!*VT100*background: black
*VT100*foreground: gray90
*VT100*background: black

I have already uncommented the two lines mentioned but this does not change xterm's behaviour. What am I missing?
There is also mention of .Xdefaults but I can't find it anywhere. Where should I look?
 
There is also mention of .Xdefaults but I can't find it anywhere. Where should I look?
Use ~/.Xresources instead, it's the same format. And the file doesn't exist by default, you'll have to create it.

After making changes you'll need to load it with xrdb(1). And then the settings will be applied to new xterm sessions.
 
This is my ~/.Xresources with a dark solarized theme

2020-03-13-192559_1366x768_scrot.png


Bash:
! Compile xft: Attempt to find a visual with the given bit depth; option -depth.
! URxvt*depth: bitdepth

! Compile xft: Turn on/off double-buffering for xft (default enabled).  On some card/driver combination enabling it slightly decreases
! URxvt*buffered: boolean

! Create the window with the specified X window geometry [default 80x24]; option -geometry.
! URxvt*geometry: geom

! Use the specified colour as the windows background colour [default White]; option -bg.
! URxvt*background: colour

! Use the specified colour as the windows foreground colour [default Black]; option -fg.
! URxvt*foreground: colour

! Use the specified colour for the colour value n, where 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-
! URxvt*colorn: colour

! URxvt*colorBD: colour

! Use the specified colour to display bold or italic characters when the foreground colour is the default. If font styles are not
! URxvt*colorIT: colour

! Use the specified colour to display underlined characters when the foreground colour is the default.
! URxvt*colorUL: colour

! If set, use the specified colour as the colour for the underline itself. If unset, use the foreground colour.
! URxvt*underlineColor: colour

! If set, use the specified colour as the background for highlighted characters. If unset, use reverse video.
! URxvt*highlightColor: colour

! If set and highlightColor is set, use the specified colour as the foreground for highlighted characters.
! URxvt*highlightTextColor: colour

! Use the specified colour for the cursor. The default is to use the foreground colour; option -cr.
! URxvt*cursorColor: colour

! Use the specified colour for the colour of the cursor text. For this to take effect, cursorColor must also be specified. The default is
! URxvt*cursorColor2: colour

! True: simulate reverse video by foreground and background colours; option -rv. False: regular screen colours [default]; option +rv. See
! URxvt*reverseVideo: boolean

! True: specify that jump scrolling should be used. When receiving lots of lines, urxvt will only scroll once a whole screen height of
! URxvt*jumpScroll: boolean

! True: (the default) specify that skip scrolling should be used. When receiving lots of lines, urxvt will only scroll once in a while
! URxvt*skipScroll: boolean

! Fade the text by the given percentage when focus is lost; option -fade.
! URxvt*fading: number

! Fade to this colour, when fading is used (see fading:). The default colour is black; option -fadecolor.
! URxvt*fadeColor: colour

! Set the application icon pixmap; option -icon.
! URxvt*iconFile: file

! Use the specified colour for the scrollbar [default #B2B2B2].
! URxvt*scrollColor: colour

! Use the specified colour for the scrollbars trough area [default #969696]. Only relevant for rxvt (non XTerm/NeXT) scrollbar.
! URxvt*troughColor: colour

! The colour of the border around the text area and between the scrollbar and the text.
! URxvt*borderColor: colour

! Select the fonts to be used. This is a comma separated list of font names that are checked in order when trying to find glyphs for
! URxvt*font: fontlist


!! background
!*background:    #101010
!*foreground:    #56B30B

!!*fading: 40
!*fadeColor: #002b36
!*cursorColor: #93a1a1
!*pointerColorBackground: #586e75
!*pointerColorForeground: #93a1a1

*background: #002b36
*foreground: #657b83
!!*fading: 40
*fadeColor: #002b36
*cursorColor: #93a1a1
*pointerColorBackground: #586e75
*pointerColorForeground: #93a1a1

!! black dark/light
*color0: #073642
*color8: #002b36

!! red dark/light
*color1: #dc322f
*color9: #cb4b16

!! green dark/light
*color2: #449307
*color10: #56B30B

!! yellow dark/light
*color3: #b58900
*color11: #657b83

!! blue dark/light
*color4: #268bd2
*color12: #839496

!! magenta dark/light
*color5: #d33682
*color13: #6c71c4

!! cyan dark/light
*color6: #2aa198
*color14: #93a1a1

!! white dark/light
*color7: #eee8d5
*color15: #fdf6e3


!! powerline fonts
URxvt*font:           xft:Inconsolata\ for\ Powerline:size=13,xft:PowerlineSymbols
!!URxvt*font:           xft:Inconsolata:size=13,xft:PowerlineSymbols
! URxvt*boldFont: fontlist

! URxvt*italicFont: fontlist

! The font list to use for displaying bold, italic or bold italic characters, respectively.
! URxvt*boldItalicFont: fontlist

! When font styles are not enabled, or this option is enabled (True, option -is, the default), bold/blink font styles imply high intensity
! URxvt*intensityStyles: boolean

! Set window title string, the default title is the command-line specified after the -e option, if any, otherwise the application name;
! URxvt*title: string

! Set the name used to label the windows icon or displayed in an icon manager window, it also sets the windows title unless it is
! URxvt*iconName: string

! True: de-iconify (map) on receipt of a bell character. False: no de-iconify (map) on receipt of a bell character [default].
! URxvt*mapAlert: boolean

! True: set the urgency hint for the wm on receipt of a bell character.  False: do not set the urgency hint [default].
! URxvt*urgentOnBell: boolean

! True: use visual bell on receipt of a bell character; option -vb.  False: no visual bell [default]; option +vb.
! URxvt*visualBell: boolean

! True: start as a login shell by prepending a - to argv[0] of the shell; option -ls. False: start as a normal sub-shell [default];
! URxvt*loginShell: boolean

! Specify the maximum time in milliseconds between multi-click select events. The default is 500 milliseconds; option -mc.
! URxvt*multiClickTime: number

! True: inhibit writing record into the system log file utmp; option -ut. False: write record into the system log file utmp [default];
! URxvt*utmpInhibit: boolean

! Specify a command pipe for vt100 printer [default lpr(1)]. Use Print to initiate a screen dump to the printer and Ctrl-Print or Shift-
! URxvt*print-pipe: string

! Set scrollbar style to rxvt, plain, next or xterm. plain is the authors favourite.
! URxvt*scrollstyle: mode
URxvt*scrollstyle: plain

! Set the scrollbar width in pixels.
! URxvt*thickness: number

! True: enable the scrollbar [default]; option -sb. False: disable the scrollbar; option +sb.
! URxvt*scrollBar: boolean
URxvt*scrollBar: False

! True: place the scrollbar on the right of the window; option -sr.  False: place the scrollbar on the left of the window; option +sr.
! URxvt*scrollBar_right: boolean
! URxvt*scrollBar_right: True

! True: display an rxvt scrollbar without a trough; option -st.  False: display an rxvt scrollbar with a trough; option +st.
! URxvt*scrollBar_floating: boolean

! Align the top, bottom or centre [default] of the scrollbar thumb with the pointer on middle button press/drag.
! URxvt*scrollBar_align: mode

! True: scroll to bottom when tty receives output; option -si.  False: do not scroll to bottom when tty receives output; option +si.
! URxvt*scrollTtyOutput: boolean

! True: scroll with scrollback buffer when tty receives new lines (i.e.  try to show the same lines) and scrollTtyOutput is False; option
! URxvt*scrollWithBuffer: boolean

! True: scroll to bottom when a non-special key is pressed. Special keys are those which are intercepted by rxvt-unicode for special
! URxvt*scrollTtyKeypress: boolean

! Save number lines in the scrollback buffer [default 1000]; option -sl.
! URxvt*saveLines: number

! Internal border of number pixels. This resource is limited to 100; option -b.
! URxvt*internalBorder: number

! External border of number pixels. This resource is limited to 100; option -w, -bw, -borderwidth.
! URxvt*externalBorder: number

! Set MWM hints to request a borderless window, i.e. if honoured by the WM, the rxvt-unicode window will not have window decorations;
! URxvt*borderLess: boolean

! Compile frills: Disable the usage of the built-in block graphics/line drawing characters and just rely on what the specified fonts
! URxvt*skipBuiltinGlyphs: boolean

! Specifies the terminal type name to be set in the TERM environment variable; option -tn.
! URxvt*termName: termname

! Specifies number of lines (pixel height) to insert between each row of the display [default 0]; option -lsp.
! URxvt*lineSpace: number

! True: handle Meta (Alt) + keypress to set the 8th bit. False: handle Meta (Alt) + keypress as an escape prefix [default].
! URxvt*meta8: boolean

! True: the mouse wheel scrolls a page full. False: the mouse wheel scrolls five lines [default].
! URxvt*mouseWheelScrollPage: boolean

! True: store tabs as wide characters. False: interpret tabs as cursor movement only; option "-ptab".
! URxvt*pastableTabs: boolean

! True: blink the cursor. False: do not blink the cursor [default]; option -bc.
! URxvt*cursorBlink: boolean

! True: Make the cursor underlined. False: Make the cursor a box [default]; option -uc.
! URxvt*cursorUnderline: boolean

! True: blank the pointer when a key is pressed or after a set number of seconds of inactivity. False: the pointer is always visible
! URxvt*pointerBlank: boolean

! Mouse pointer foreground colour.
! URxvt*pointerColor: colour

! Mouse pointer background colour.
! URxvt*pointerColor2: colour

! Compile frills: Specifies the name of the mouse pointer shape [default xterm]. See the macros in the X11/cursorfont.h include file for
! URxvt*pointerShape: string

! Specifies number of seconds before blanking the pointer [default 2]. Use a large number (e.g. 987654321) to effectively disable the
! URxvt*pointerBlankDelay: number

! The string to send when the backspace key is pressed. If set to DEC or unset it will send Delete (code 127) or, with control, Backspace
! URxvt*backspacekey: string

! The string to send when the delete key (not the keypad delete key) is pressed. If unset it will send the sequence traditionally
! URxvt*deletekey: string

! The characters used as delimiters for double-click word selection (whitespace delimiting is added automatically if resource is given).
! URxvt*cutchars: string

!
! URxvt*{|}

! OnTheSpot, OverTheSpot, OffTheSpot, Root; option -pt.
! URxvt*preeditType: style

! name of inputMethod to use; option -im.
! URxvt*inputMethod: name

! The locale to use for opening the IM. You can use an "LC_CTYPE" of e.g.  "de_DE.UTF-8" for normal text processing but "ja_JP.EUC-JP" for
! URxvt*imLocale: name

! Specify the font-set used for XIM styles "OverTheSpot" or "OffTheSpot". It must be a standard X font set (XLFD patterns separated by
! URxvt*imFont: fontset

! Change the meaning of triple-click selection with the left mouse button. Instead of selecting a full line it will extend the selection
! URxvt*tripleclickwords: boolean

! Enables "insecure" mode. Rxvt-unicode offers some escape sequences that echo arbitrary strings like the icon name or the locale. This
! URxvt*insecure: boolean

! Set the key to be interpreted as the Meta key to: alt, meta, hyper, super, mod1, mod2, mod3, mod4, mod5; option -mod.
! URxvt*modifier: modifier
URxvt*modifier: mod1

! Specify the reply rxvt-unicode sends to the shell when an ENQ (control-E) character is passed through. It may contain escape values as
! URxvt*answerbackString: string

! Turn on/off secondary screen (default enabled).
! URxvt*secondaryScreen: boolean

! Turn on/off secondary screen scroll (default enabled). If this option is enabled, scrolls on the secondary screen will change the
! URxvt*secondaryScroll: boolean

! Turn on/off hold window after exit support. If enabled, urxvt will not immediately destroy its window when the program executed within
! URxvt*hold: boolean

! Sets the working directory for the shell (or the command specified via -e). The path must be an absolute path and it must exist for
! URxvt*chdir: path

! Compile frills: Associate action with keysym sym. The intervening resource name keysym. cannot be omitted.
! URxvt*keysym.sym: action

! URxvt*perl-ext-common: string
URxvt*perl-ext-common: default,clipboard,selection-to-clipboard,font-size

! copy and paste, alt + control + c, alt + control + v
!URxvt.keysym.Alt-Control-C: perl:clipboard:copy
!URxvt.keysym.Alt-Control-V: perl:clipboard:paste

URxvt.keysym.M-C-c: eval:selection_to_clipboard
URxvt.keysym.M-C-v: eval:paste_clipboard

! shift
!URxvt.keysym.Shift-Up:          \033[1;2A
!URxvt.keysym.Shift-Down:        \033[1;2B
!URxvt.keysym.Shift-Right:       \033[1;2C
!URxvt.keysym.Shift-Left:        \033[1;2D

! alt/meta
!URxvt.keysym.M-Up             : \033[1;3A
!URxvt.keysym.M-Down           : \033[1;3B
!URxvt.keysym.M-Right          : \033[1;3C
!URxvt.keysym.M-Left           : \033[1;3D

! alt/meta + shift
!URxvt.keysym.M-S-Up           : \033[1;4A
!URxvt.keysym.M-S-Down         : \033[1;4B
!URxvt.keysym.M-S-Right        : \033[1;4C
!URxvt.keysym.M-S-Left         : \033[1;4D

! Comma-separated list(s) of perl extension scripts (default: "default") to use in this terminal instance; option -pe.
! URxvt*perl-ext: string

! Perl code to be evaluated when all extensions have been registered. See the urxvtperl(3) manpage.
! URxvt*perl-eval: string

! Colon-separated list of additional directories that hold extension scripts. When looking for perl extensions, urxvt will first look in
!URxvt*perl-lib: ~/.urxvt/ext/

! Additional selection patterns, see the urxvtperl(3) manpage for details.
! URxvt*selection.pattern-idx: perl-regex

! Selection auto-transform patterns, see the urxvtperl(3) manpage for details.
! URxvt*selection-autotransform.idx: perl-transform

! This resource is deprecated and will be removed. Use a keysym resource instead, e.g.:
! URxvt*searchable-scrollback: keysym *DEPRECATED*

! Specifies the program to be started with a URL argument. Used by the "selection-popup" and "matcher" perl extensions.
! URxvt*url-launcher: string

! Compile frills: Sets the WM_TRANSIENT_FOR property to the given window id.
! URxvt*transient-for: windowid

! Compile frills: Sets override-redirect for the terminal window, making it almost invisible to window managers; option
! URxvt*override-redirect: boolean

! Turn on/off ISO 14755 (default enabled).
URxvt*iso14755: False
URxvt.iso14755_52: false

! Turn on/off ISO 14755 5.2 mode (default enabled).
!URxvt*iso14755_52: boolean

Xresources is used when you when you login in using startx
whereas Xdefaults is used when you login using a login manager

I only use i3wm on Freebsd which i start with startx so i use ~/.Xresources

On my ubuntu machine which i think uses the gdm or ldm login manager
you have to rename the ~/.Xresources file to ~/.Xdefaults for it to work
 
Dark background xterm and transparency.

xterm.png


Code:
! XTERM COLORS & FONTS
! !-----------------------------------------------
XTerm.vt100.foreground: white
XTerm.vt100.background: rgb:14/14/14
XTerm.vt100.color0: rgb:28/28/28
XTerm.vt100.faceName: Monospace:size=10:antialias=false
XTerm.vt100.font: 7x13

! XTERM COPY/PASTE
! !----------------------------------------------
XTerm.selectToClipboard: true
 
Here is a HUGE set of themes you can try (with examples):

 
Back
Top