xterm not loading xresources properly

6,237

Solution 1

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

Solution 2

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!

Share:
6,237

Related videos on Youtube

sitilge
Author by

sitilge

Updated on September 18, 2022

Comments

  • sitilge
    sitilge over 1 year

    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

    #!/bin/sh
    
    [[ -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
    
    • John1024
      John1024 almost 8 years
      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?
    • sitilge
      sitilge almost 8 years
      @ThomasDickey please, see the update.
    • sitilge
      sitilge almost 8 years
      @John1024 no, nothing...
    • sitilge
      sitilge almost 8 years
      @ThomasDickey it seems that I am running in circles here. Nothing in logs.
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' almost 8 years
      Post the output of appres XTerm xterm as well (assuming you start xterm as xterm). This shows the resources that are in actual use.
    • sitilge
      sitilge almost 8 years
      appres isn't available. Is xrdb -query -all ok for you?
    • derobert
      derobert almost 8 years
      are you sure your .xinitrc is actually being run? Add an xclock & or something in there to be sure...
    • sitilge
      sitilge almost 8 years
      @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.
    • terdon
      terdon almost 8 years
      Are you sure that .xinitrc is sourced by bash? You haven't told us your distribution but many don't use bash as the default shell for this sort of thing. Does it work if you change the [[ ]] to single [ ]?
    • sitilge
      sitilge almost 8 years
      @terdon it's arch. It was sh earlier, swithced back. But, sadly, it still doesn't work.
    • terdon
      terdon almost 8 years
      Please edit your question and mention your OS then. You should also mention your login manager and desktop environment, these could be relevant. It might also help if you stated the problem you're facing more clearly. It took me a while to understand that the problem is that xinitrc isn't being sourced. That said, changing the shebang line will make no difference. Did you try using [ ] instead of [[ ]] as I suggested?
    • sitilge
      sitilge almost 8 years
      @terdon actually, I guess I solved the problem. A tiny bit of an incorrect syntax in Xresources was the problem. Closing now.
    • terdon
      terdon almost 8 years
      Great! Not sure what you mean by "closing" but if you can, please post an answer with your solution and accept it. That might help the next person with the same problem.
    • sitilge
      sitilge almost 8 years
      @terdon sure, just a sec.
  • derobert
    derobert over 7 years
    Errrr.... do you have the C preprocessor installed? You could also try adding -cpp /usr/bin/cpp to your xrdb options.