[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Xdefaults versus Xresources (Re: Help!)



Antonio Rodriguez wrote:
> Speaking of which, whats the difference between .Xdefaults and
> .Xresources? I have had to copy settings from .Xdefaults to
> .Xresources because it was not working, even after loging out and
> back.

The .Xdefaults file is the old way of doing resources.  They are read
from your home directory on the host that you start the X application.
But this made various things very difficult or impossible.  Let's say
you have two displays that are different, one big and one small, and
want a bigger font on one display than on the other display.

The .Xresources file came later and is, by convention, loaded at X
start time by the 'startx' script wrapper around xinit.  The startx
wrapper calls 'xrdb -l ~/.Xresources' to install that data into the X
resource database in memory for the $DISPLAY.  Because this is display
specific and not home directory specific it solves some of the
problems with the .Xdefaults file such as the example above.

If any X resources exist in memory by xrdb then the .Xdefaults is not
used.  The search path for X applications to find their resources
looks in memory first and on disk second.  Because many modern window
managers (KDE I know for sure, not sure about gnome) use xrdb
themselves then for sure something will be found there and the on disk
.Xdefaults will never be consulted.  The xrdb in memory database is a
better way to go anyway.  So the .Xdefaults is basically obsolete.  As
an fvwm user I could still make use of it.  But I load the .Xresources
file too to use the defacto convention.

Any documentation you see referencing .Xdefaults is likely to be more
than ten years old.  I can't remember when .Xresources came into
existence but it was a long time ago.  Perhaps at the conversion from
X10 to X11.  (Yes, I was an X10 user before there was an X11.)

Sorry this posting was not the most accurate of references.  I just
flung it out from faded memory.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: