You are not logged in.

#1 2016-05-28 17:14:10

Eam404
Member
Registered: 2006-10-25
Posts: 20

[SOLVED] .Xresources

Hi !

Before I dig into this issue Id like to mention I have researched solutions thoroughly and cant seem to find a solution.


Problem

.Xresources does not seem to get phrased and evaluated. #includes and #defines also seem to not load.

Problem Details

I have a very standard new install of Arch. I have installed the normal set of applications such as nvidia, xorg-server, xorg-xrdb, openbox, and urxvt-unicode.

The .Xresources I am using is located HERE and essentially contains #includes, and some basic xft settings

Additionally I have a urxvt config located HERE that defines basic terminal settings.

The config files and files that I call in the #includes are located HERE

The first issue is that .Xresources does not seem to get phrased completely. I am able to verify the xrdb -merge commands within .xinitrc and when I

xrdb -query all

I can see the xft settings load. It does not show #includes which I assume is normal behavior. This essentially tells me that .Xresources is loaded.

My urxvt settings do not get applied or rather it seems the #include that references my "theme" is not being taken into account. If I put the color scheme settings directly in .Xresources i can get it to work.

Whats even more odd is if I system link .Xdefaults to .Xresources it seems to work and does load and phrase the #include files.

In this state another strange issue crops up

In my theme files I set variables with the following:

#define termbg #140720
#define termfg #e0d6cd 

However when I call termbf and termfb from within my urxvt config file it does not work. Basically saying it does not understand what the variables termfb and termbg are and renders the background as pink.

All in all it seems like the #defines are not working.

So to summarize I have two problems:

  1. I can not figure out why .Xresources does not work with #includes, but does work when I sym link to .Xdefaults

  2. When using the system link to .Xdefaults #defines are not working within my theme files.

UPDATE: I suppose it could be a URxvt specific problem but I would assume not.

I greatly appreciate the help here as this is driving me nuts. I'm happy to provide more detail or config files if needed.

Last edited by Eam404 (2016-05-29 03:18:28)

Offline

#2 2016-05-29 01:18:30

Ziusudra
Member
Registered: 2014-04-19
Posts: 120

Re: [SOLVED] .Xresources

https://wiki.archlinux.org/index.php/X_resources#Include_files wrote:

If files fail to load, specify the directory to xrdb with the -I parameter.

So I think you would use "xrdb -I$HOME/.Xresources.d ~/.Xresources". (That's a capital i btw.)

I'm seeing some google results that mention xrdb not always parsing define statements, but one thing at a time.

Offline

#3 2016-05-29 01:23:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED] .Xresources

How/when/where do you actually load the Xresources file?

Urxvt does not read Xresources, but it does read Xdefaults.  So it sounds like you just aren't loading Xresources.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2016-05-29 01:31:45

Ziusudra
Member
Registered: 2014-04-19
Posts: 120

Re: [SOLVED] .Xresources

The linked github also includes a .bash_profile that does the startx and a mostly default .xinitrc that loads the system and user .Xresources files.

Offline

#5 2016-05-29 02:00:39

Eam404
Member
Registered: 2006-10-25
Posts: 20

Re: [SOLVED] .Xresources

Thanks for the replies!

@Trilby - Xresources is loaded based on the entry with .xinitrc

SNIPPET

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

Offline

#6 2016-05-29 02:09:10

Eam404
Member
Registered: 2006-10-25
Posts: 20

Re: [SOLVED] .Xresources

Ziusudra wrote:
https://wiki.archlinux.org/index.php/X_resources#Include_files wrote:

If files fail to load, specify the directory to xrdb with the -I parameter.

So I think you would use "xrdb -I$HOME/.Xresources.d ~/.Xresources". (That's a capital i btw.)

I'm seeing some google results that mention xrdb not always parsing define statements, but one thing at a time.

I tried this with no luck. To be clear .Xresources is located in my home directory. It seems like .Xresources does load as when I query xrdb I see the xft font rendering options.

Offline

#7 2016-05-29 02:22:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] .Xresources

Your setup seems (unneccessarily) complex. Why don't you just use a single .Xresources and load that from .xinitrc? At least until you narrow down the issue...

FWIW, the first thing I would change would be absolute paths in the #include calls.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2016-05-29 02:24:55

Ziusudra
Member
Registered: 2014-04-19
Posts: 120

Re: [SOLVED] .Xresources

Eam404 wrote:

I tried this with no luck. To be clear .Xresources is located in my home directory. It seems like .Xresources does load as when I query xrdb I see the xft font rendering options.

The -I option is to tell the pre-processor where to find the files included by the .Xresources  - not where the the .Xreources file itself is.

Sorry, since the #include directives already specify the ".Xresources.d" directory it should just be "-I$HOME"

What if you try "xrdb -merge -ccp /usr/bin/cpp -I$HOME ~/.Xresources"?

Offline

#9 2016-05-29 02:57:21

Eam404
Member
Registered: 2006-10-25
Posts: 20

Re: [SOLVED] .Xresources

Ziusudra wrote:
Eam404 wrote:

I tried this with no luck. To be clear .Xresources is located in my home directory. It seems like .Xresources does load as when I query xrdb I see the xft font rendering options.

The -I option is to tell the pre-processor where to find the files included by the .Xresources  - not where the the .Xreources file itself is.

Sorry, since the #include directives already specify the ".Xresources.d" directory it should just be "-I$HOME"

What if you try "xrdb -merge -ccp /usr/bin/cpp -I$HOME ~/.Xresources"?

You had a small type-o ccp = cpp smile

Wow! I noticed cpp didn't exist and I didnt see it in a pacman search. However mccp does exist and is listed as being a pre-processor alternative.

I ran the following:

rdb -merge -cpp /usr/bin/mcpp ~/.Xresources

This worked!!

I do not understand why this worked I was under the impression that xrdb runs the input files through the pre-processor by deault. I'm also not sure why Im missing /usr/bin/cpp ?

Is there a seperate package for the binary cpp?

Also, thank you very much.

Offline

#10 2016-05-29 02:58:40

Eam404
Member
Registered: 2006-10-25
Posts: 20

Re: [SOLVED] .Xresources

jasonwryan wrote:

Your setup seems (unneccessarily) complex. Why don't you just use a single .Xresources and load that from .xinitrc? At least until you narrow down the issue...

FWIW, the first thing I would change would be absolute paths in the #include calls.

Completely understand - however this setup is not complex to me - it allows me to create and switch color schemes very easily. I think you are right in regards to troubleshooting. It seems .Xresources was not being feed through the pre-processor.

Offline

#11 2016-05-29 03:03:36

Ziusudra
Member
Registered: 2014-04-19
Posts: 120

Re: [SOLVED] .Xresources

Eam404 wrote:

Is there a seperate package for the binary cpp?

$ pacman -Qo /usr/bin/cpp
/usr/bin/cpp is owned by gcc-multilib 6.1.1-1

So, it should also be installed by the gcc package which is part of the base-devel group.

Edit: The xorg-xrdb package does list mcpp as an alternative to the optional dependency on gcc. I'm surprised the mcpp package doesn't provide a symlink at /usr/bin/cpp.

Last edited by Ziusudra (2016-05-29 03:13:11)

Offline

#12 2016-05-29 03:17:49

Eam404
Member
Registered: 2006-10-25
Posts: 20

Re: [SOLVED] .Xresources

Well that explains it! As I mentioned in the first post it was a new install I had not installed gcc yet! Go figure!

Thanks again for the help I will mark the posted as solved.

I cant believe after hours of troubleshooting it came down to gcc...

Offline

Board footer

Powered by FluxBB