When booting into my window manage (xmonad), gtk fonts are anti-aliased, but for some reason urxvt has problems with variable names in my ~/.Xdefaults (it fails to parse the variable names as colors and thus everything is pink). This is fixed by running xrdb -merge ~/.Xdefaults. However, doing this seems to disable anti-aliasing for fonts in gtk apps, but not in urxvt.

What would be causing this?

I've since moved my ~/.Xdefaults to ~/.Xresources, and now, gtk antialiasing seems to not be working from the get-go, but I still need to run xrdb -merge ~/.Xresources to get urxvt to parse the color variables.

My ~/.Xresources:

Xft.dpi: 96
Xft.lcdfiler: lcddefault
Xft.antialias: true
Xft.hinting: true
Xft.hintstyle: hintfull

URxvt.font: xft:Dejavu Sans Mono:size=11:antialias=true:hinting=true

URxvt*scrollBar: true
URxvt*scrollBar_right: true
URxvt*scrollstyle: plain

URxvt.urgentOnBell: true

! From https://bbs.archlinux.org/viewtopic.php?id=164108
URxvt.intensityStyles: false

! From https://raw.github.com/solarized/xresources/master/solarized
! Solarized color scheme for the X Window System
! http://ethanschoonover.com/solarized

! Common

#define S_yellow        #b58900
#define S_orange        #cb4b16
#define S_red           #dc322f
#define S_magenta       #d33682
#define S_violet        #6c71c4
#define S_blue          #268bd2
#define S_cyan          #2aa198
#define S_green         #859900

! Dark

#define S_base03        #002b36
#define S_base02        #073642
#define S_base01        #586e75
#define S_base00        #657b83
#define S_base0         #839496
#define S_base1         #93a1a1
#define S_base2         #eee8d5
#define S_base3         #fdf6e3

! Light

! #define S_base03        #fdf6e3
! #define S_base02        #eee8d5
! #define S_base01        #93a1a1
! #define S_base00        #839496
! #define S_base0         #657b83
! #define S_base1         #586e75
! #define S_base2         #073642
! #define S_base3         #002b36

! To only apply colors to your terminal, for example, prefix
! the color assignment statement with its name. Example:
! URxvt*background:            S_base03

*background:              S_base03
*foreground:              S_base0
*fading:                  40
*fadeColor:               S_base03
*cursorColor:             S_base1
*pointerColorBackground:  S_base01
*pointerColorForeground:  S_base1

*color0:                  S_base02
*color1:                  S_red
*color2:                  S_green
*color3:                  S_yellow
*color4:                  S_blue
*color5:                  S_magenta
*color6:                  S_cyan
*color7:                  S_base2
*color8:                  S_base03
*color9:                  S_orange
*color10:                 S_base01
*color11:                 S_base00
*color12:                 S_base0
*color13:                 S_violet
*color14:                 S_base1
*color15:                 S_base3

Many X programs (including Urxvt) that use resources load ~/.Xdefaults when they start and apply the resources they find there. When they do that, they don't apply any preprocessing, so your #define directives have no effect, which explains the messages like

urxvt: unable to parse color 'S_base0', using pink instead.

The Xrdb program loads a resource file into the server and these resources apply to all applications that are started subsequently. Xrdb preprocesses the input file with the C preprocessor cpp (unless instructed otherwise).

If some resources seemingly change when you switch from .Xdefaults loaded by applications to .Xresources loaded at the beginning of the session, this may be due to some other part of your configuration (perhaps a system-wide one) loading something else afterwards. If loading .Xresources manually after the session starts makes a difference, that's what's going on; you'll need to check your session and window manager startup routines. Check what the actual resources are with xrdb -query | grep '^Xft' and with listres Xft.

Most Gtk applications ignore X resources, you need to use fontconfig settings instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.