[SOLVED] xrdb does not read ~/.Xresources ???

General support questions
Post Reply
chemist
Posts: 26
Joined: 2014/08/21 17:15:28

[SOLVED] xrdb does not read ~/.Xresources ???

Post by chemist » 2014/08/21 17:29:40

Hi,
I am using the latest Centos 7 ( KDE with 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux).

Several programs upon launching render their windows having black backgrounds. These windows are operational but hardly readable.
After googling,this can be fixed by creating ~/.Xresources file with the only string " *.background: gray75 "
followed by typing "xrdb ~/.Xresources" in bash.
This is boring. Could you propose a solution to perform this command "xrdb ..." at login , please ?

Also, from where does this problem come ? Neither in Centos 5.x nor in 6.x version I have encountered this particular bug...

Thx much in advance

User avatar
ongoto
Posts: 6
Joined: 2014/08/15 08:38:33
Location: USA

Re: xrdb does not read ~/.Xresources ???

Post by ongoto » 2014/08/25 02:38:25

I've wondered about this myself.
What happens if you run:
$ xrdb -merge ~/.Xresources
?

There is already a startup script that does this, but the merge doesn't seem to happen...
/etc/X11/xinit/xinit-common

Code: Select all

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap

# merge in defaults
[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources"
[ -r "$userresources" ] && xrdb -merge "$userresources"

-- Only a penguin could make a nest out of some rocks --

chemist
Posts: 26
Joined: 2014/08/21 17:15:28

Re: xrdb does not read ~/.Xresources ???

Post by chemist » 2014/08/25 11:12:02

When I type
xrdb -merge ~/.Xresources

I get no any message.

The content of xinitrc-common:

Code: Select all

# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.                                                                                                 
#                                                                                                                                       
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# xinitrc-common
#
# This is common code shared by both Xsession and xinitrc scripts.  Be sure
# to take this into account when fixing bugs or adding new functionality.

# Set up i18n environment
if [ -r /etc/profile.d/lang.sh ]; then
  . /etc/profile.d/lang.sh
fi

[ -r $HOME/.profile ] && . $HOME/.profile

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap

# merge in defaults
[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources"
[ -r "$userresources" ] && xrdb -merge "$userresources"

# merge in keymaps
if [ -r "$sysxkbmap" ]; then
    setxkbmap $(cat "$sysxkbmap")
    XKB_IN_USE=yes
fi

if [ -r "$userxkbmap" ]; then
    setxkbmap $(cat "$userxkbmap")
    XKB_IN_USE=yes
fi

# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
    [ -r "$sysmodmap" ] && xmodmap "$sysmodmap"
    [ -r "$usermodmap" ] && xmodmap "$usermodmap"
fi

unset XKB_IN_USE

# run all system xinitrc shell scripts.
for file in /etc/X11/xinit/xinitrc.d/* ; do
        . $file
done

# Prefix launch of session with ssh-agent if available and not already running.
SSH_AGENT=
if [ -z "$SSH_AGENT_PID" ] && [ -x /usr/bin/ssh-agent ]; then
    if [ "x$TMPDIR" != "x" ]; then
        SSH_AGENT="/usr/bin/ssh-agent /bin/env TMPDIR=$TMPDIR"
    else
        SSH_AGENT="/usr/bin/ssh-agent"
  fi
fi

CK_XINIT_SESSION=
if [ -z "$XDG_SESSION_COOKIE" ] && [ -x /usr/bin/ck-xinit-session ]; then
    CK_XINIT_SESSION="/usr/bin/ck-xinit-session"
fi


And I do not have files
.Xmodmap
.Xkbmap

in my $HOME folder ...




ongoto wrote:I've wondered about this myself.
What happens if you run:
$ xrdb -merge ~/.Xresources
?

There is already a startup script that does this, but the merge doesn't seem to happen...
/etc/X11/xinit/xinit-common

Code: Select all

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap

# merge in defaults
[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources"
[ -r "$userresources" ] && xrdb -merge "$userresources"


User avatar
ongoto
Posts: 6
Joined: 2014/08/15 08:38:33
Location: USA

Re: xrdb does not read ~/.Xresources ???

Post by ongoto » 2014/08/25 15:36:13

And I do not have files
.Xmodmap
.Xkbmap

in my $HOME folder ...
That's OK. The defaults will get used instead.
---

The *.Background advice you got was wrong. Should be all lower case and no leading dot.
Replace what you have in $HOME/.Xresources with this:

Xft.dpi: 96
Xft.hinting: true
Xft.hintstyle: hintfull
*background: gray75

Then try xrdb -merge .Xresources again. (sometimes it helps to logout)

If this doesn't change anything for you, then I'm at a loss.
It also matters what application windows you are referring to. They can each have their own color settings which override .Xresources.
-- Only a penguin could make a nest out of some rocks --

chemist
Posts: 26
Joined: 2014/08/21 17:15:28

Re: xrdb does not read ~/.Xresources ???

Post by chemist » 2014/08/25 16:30:50

now this works

thank you !

ongoto wrote:
And I do not have files
.Xmodmap
.Xkbmap

in my $HOME folder ...
That's OK. The defaults will get used instead.
---

The *.Background advice you got was wrong. Should be all lower case and no leading dot.
Replace what you have in $HOME/.Xresources with this:

Xft.dpi: 96
Xft.hinting: true
Xft.hintstyle: hintfull
*background: gray75

Then try xrdb -merge .Xresources again. (sometimes it helps to logout)

If this doesn't change anything for you, then I'm at a loss.
It also matters what application windows you are referring to. They can each have their own color settings which override .Xresources.

Post Reply