You are not logged in.

#1 2009-05-08 07:44:35

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

[SOLVED] .Xdefaults vs. .Xresources

I am slightly confused about the roles the .Xdefaults and .Xresources files play in Arch.

As far as I understand, based on my (B)LFS experiences, .Xdefaults was considered obsolete and should have been replaced by .Xresources. Now I know many applications still refer to .Xdefaults instead of .Xresources, thus I symlinked .Xdefaults to my .Xresources file. But is this advisable? Are .Xdefaults definitions in any way different from the .Xresources ones?

Is there as rationale why .Xdefaults was preferred over .Xresources? The wiki not even mentiones .Xresources in the .Xdefaults article. And a wiki search for .Xresources finds more inferior mentions only.
How is this handled in other distributions?

Last edited by bernarcher (2009-05-08 19:17:35)


To know or not to know ...
... the questions remain forever.

Offline

#2 2009-05-08 08:13:35

adamlau
Member
Registered: 2009-01-30
Posts: 418

Re: [SOLVED] .Xdefaults vs. .Xresources

All I know is that urxvt follows .Xdefaults and xterm, .Xresources.


Arch Linux + sway
Debian Testing + GNOME/sway
NetBSD 64-bit + Xfce

Offline

#3 2009-05-08 08:48:01

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: [SOLVED] .Xdefaults vs. .Xresources

adamlau wrote:

All I know is that urxvt follows .Xdefaults and xterm, .Xresources.

Not really..I don't even have an .Xresources. All my X user life I've been doing everything with ~/.Xdefaults


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#4 2009-05-08 10:37:53

app4des
Member
Registered: 2009-02-18
Posts: 39

Re: [SOLVED] .Xdefaults vs. .Xresources

.Xresources and .Xdefaults files are read when X starts (Different applications don't read different files, the xrdb database is the same). Which file is read probably depends on the Xorg version.

Whatever, just ignore these files and load your own with "xrdb" on some startup scripts. "xrdb whateverfile" will work too. Don't forget to use "xrdb -merge" if you want to load multiple files, because else each resource file overwrites the previous resources.

Personally I use something like that in the openbox's autostart.sh so I can have all the configurations on that file:

echo "URxvt.background:black" | xrdb -merge
echo "URxvt.foreground:white" | xrdb -merge
etc . .

Last edited by app4des (2009-05-08 10:38:31)

Offline

#5 2009-05-08 11:04:01

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] .Xdefaults vs. .Xresources

Naah. This xrdb stuff is awkward. It should be used for individual adaptations only. Those centralized .X... resource definitions are for a purpose.

Yet it is true, .Xdefaults/.Xresources should be processed by xrdb on Xorg startup. Nonetheless, I found some X applications failing if either one was missing.

I did not check for some time, however. Just remember some urxvt initialization problems when no .Xdefaults was present.

I just found this one in the "X Resources" Wikipedia article:

X resources are stored in the server rather than in a configuration file to allow programs started from other computers to use them. Indeed, a program connecting to an X server from another computer can access the resources via the X protocol. Using the old system of storing program parameters in the .Xdefaults file creates the need of copying this file to all other computers where a program can be started.

So there are differences, but when and how do they really matter.?


To know or not to know ...
... the questions remain forever.

Offline

#6 2009-05-08 16:36:41

app4des
Member
Registered: 2009-02-18
Posts: 39

Re: [SOLVED] .Xdefaults vs. .Xresources

The problem that many people may have is that if both .Xdefaults and .Xresources are being read by X at start up, the one that is read last will delete all the resources mentioned by the other, that is because probably X uses standard xrdb and not xrdb -merge.

Using "xrdb -merge" manually on a file (or files) yourself as I mentioned before will solve all problems.

You can always see what resources have been parsed anytime with "xrdb -query" (from within X session).

Offline

#7 2009-05-08 19:17:02

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] .Xdefaults vs. .Xresources

Now I got it. smile
This did bother me for years. Kind of a relief.

Thanks!


To know or not to know ...
... the questions remain forever.

Offline

Board footer

Powered by FluxBB