There are similar questions out there, however, I was not able to figure out the flaws in my .xinitrc file which causes .Xresources not to load. The respective .xinitrc


[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources

exec startxfce4

The respective DE is xfce4, using no login manager (startx only), running on arch. I've read the wiki and posts out there, nothing seems to solve the issue...

The .Xresources file

#define _background #272822
#define _color8 #303030

#define _foreground #d0d0d0
#define _color9 #ff0090

#define _color2 #66AA11
#define _color10 #80FF00

#define _color3 #c47f2c
#define _color11 #ffba68

#define _color4 #30309b
#define _color12 #5f5fee

#define _color5 #7e40a5
#define _color13 #bb88dd

#define _color6 #3579A8
#define _color14 #4eb4fa

#define _color7 #9999AA
#define _color15 #ffffff

xterm*background: _background
xterm*foreground: _foreground

xterm*cursorColor: _foreground

xterm*color0: _background
xterm*color1: _foreground
xterm*color2: _color2
xterm*color3: _color3
xterm*color4: _color4
xterm*color5: _color5
xterm*color6: _color6
xterm*color7: _color7
xterm*color8: _color8
xterm*color9: _color9
xterm*color10: _color10
xterm*color11: _color11
xterm*color12: _color12
xterm*color13: _color13
xterm*color14: _color14
xterm*color15: _color15
  • The -I option is only useful if your resource-files use #include. If you show your ~/.Xresources, that might help. – Thomas Dickey Jul 16 '16 at 20:16
  • That bash line looks correct. I suspect that you problem lies somewhere else. Have your tried running xrdb -merge -I$HOME ~/.Xresources on its own and seeing if any errors appear either on the screen or in the X11 log? – John1024 Jul 16 '16 at 20:18
  • 1
    appres isn't available. Is xrdb -query -all ok for you? – sitilge Jul 16 '16 at 21:24
  • 1
    are you sure your .xinitrc is actually being run? Add an xclock & or something in there to be sure... – derobert Jul 16 '16 at 21:31
  • 1
    @derobert hmm, good point. It feels that it is run. Just mv the filename and the xfce wasn't started... Reverted -> works fine -> it must be loaded. – sitilge Jul 16 '16 at 21:49

The problem was incorrect syntax in .Xresources file. It seemed that the #define syntax is not working; thus using the hex codes directly solved the issue. An example:

*.foreground:   #ababab
*.background:   #000000
*.cursorColor:  #ababab
  • 2
    Errrr.... do you have the C preprocessor installed? You could also try adding -cpp /usr/bin/cpp to your xrdb options. – derobert Aug 5 '16 at 0:44

I had same problem:

Clearest way is:

  1. copy /etc/xdg/xfce4/xinitrc to ~/.config/xfce4/
  2. Edit ~/.config/xfce4/xinitrc, find the line:

cat /dev/null $XRESOURCES | xrdb --nocpp -merge -

  1. delete --nocpp, so that the line now looks like

cat /dev/null $XRESOURCES | xrdb -merge -

  1. save

Good luck!

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.