You are not logged in.
Hey all, I'm fairly new to Arch, but have been using Linux for some time now (started on Ubuntu and migrated to Debian then to Arch). I've learned a lot installing and configuring a system with Arch, and the excellent documentation has gotten me pretty far.
I'm now stuck on an issue that seems like it should be trivial.
I'm running urxvt as my terminal emulator (in daemon mode, but my problem occurs with straight urxvt as well). I've got it configured to use Solarized as a theme through modifying my .Xresources with the appropriate colors. Unfortunately, when I boot my system, the coloring is a uniform pink (including all text - I can't see anything I type or any prompt or even the cursor), though the terminal is functional (I can type commands and they execute properly, at least those with effects external to the terminal window). I have to run the following to fix colors:
$ xrdb .XresourcesAfter I do this and open a new terminal, everything is hunky dory.
I have added the following to my .xinitrc file from this wiki entry (which I had to create - I did not have .xinitrc prior to messing with urxvt and Solarized):
[[ -f ~/.Xresources ]] && xrdb -merge ~/.XresourcesI at first used the default .xinitrc in /etc/skel included as part of xorg-xinit, but still saw this issue, so I commented out everything except for the line above. I then removed '-merge' as that differs from the command that fixes my problem when run from the command line, so now my .xinitrc consists only of this line:
[[ -f ~/.Xresources ]] && xrdb ~/.XresourcesTo be honest I'm not that familiar with shell scripts, but to my limited understanding this is saying run
$ xrdb ~/.Xresourcesif the file ~./Xresources exists, which is the behavior I want.
I have checked my xinitrc in /etc/X11/xinit and it consists of the following:
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"
fiI'm reading this as: if each of these files exists, then read them with the proper program. I do not have /etc/X11/xinit/.Xresources, so the only thing being loaded should be my ~/.Xresources (and if it doesn't work here, my ~/.xinitrc should kick in and load it is my understanding).
I can't seem to wrap my mind around where the issue is, and why $ xrdb ~/.Xresources is not being run properly until I enter it in the command line on boot.
Any help you can provide is greatly appreciated.
TL;DR: urxvt has funky coloring on boot, must run
$ xrdb ~/.Xresourcesto fix. This command is seemingly called in the system xinitrc and my .xinitrc.
Last edited by greggyb (2014-09-06 05:12:52)
Offline
Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_Code
Is your .xinitrc being run at all? How are you logging in and to what?
Offline
By far the easiest approach would be to rename your ~/.Xresources to be ~/.Xdefaults as urxvt loads that itself.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
jasonwryan, I've edited my post with code tags; my apologies on that front.
I am using lxdm as display/login manager, and my understanding is the the DM automatically handles all the X stuff for you.
Looking at the config I see two sections that seem relevant:
# Load resources
for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do
if [ -f "$file" ]; then
echo "Loading resource: $file"
xrdb -nocpp -merge "$file"
fi
doneand
# Run all system xinitrc shell scripts.
xinitdir="/etc/X11/xinit/xinitrc.d"
if [ -d "$xinitdir" ]; then
for script in $xinitdir/*; do
echo "Loading xinit script $script"
if [ -x "$script" -a ! -d "$script" ]; then
. "$script"
fi
done
fiIt looks like .Xresources is being loaded here as well. I'm not sure on the xinitrc, because that is in /etc/X11/xinit, not in /etc/X11/xinit/xinitrc.d. The only item in the latter is 30-dbus:
#!/bin/bash
# launches a session dbus instance
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && type dbus-launch >/dev/null; then
eval $(dbus-launch --sh-syntax --exit-with-session)
fiI'm not really sure what's going on there.
LXDM launches me into i3, and I don't have anything referring to X in my i3 config file (well, a little bit of keymapping for mappings I only want in i3 with a special file for xmodmap, but I can't see that affecting colors in my terminal).
One of my thoughts was just to add
exec xrdb ~/.Xresourcesto the end of my i3 config, but that seems not to be the right solution.
Trilby, I didn't use ~/.Xdefaults, as I read in the wiki pages that it is deprecated and ~/.Xresources is the way to go - would it be bad to rename to ~/.Xdefaults? I'm trying to keep my install very clean and follow current standards, though if I cannot find other resolution, I'll probably come back to this.
Last edited by greggyb (2014-09-06 01:59:42)
Offline
LXDM doesn't read ~/.xinitrc: it has its own files (post load and the like)...
Offline
Does LXDM not read the Xsession file in /etc/lxdm? Because that's got this section:
# Load resources
for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do
if [ -f "$file" ]; then
echo "Loading resource: $file"
xrdb -nocpp -merge "$file"
fi
doneOr, since that's a system-wide Xsession file, is it looking in /root for $HOME, rather than /home/<user>?
If that is the case is it as simple as putting
[[ -f ~/.Xresources ]] && xrdb ~/.Xresources into LXDM's /etc/lxdm/PostLogin script?
If yes, is that code correct? Shell scripting is on my ever-growing list of things to learn more about.
Thanks very much.
Offline
Trilby, I didn't use ~/.Xdefaults, as I read in the wiki pages that it is deprecated and ~/.Xresources is the way to go - would it be bad to rename to ~/.Xdefaults? I'm trying to keep my install very clean and follow current standards, though if I cannot find other resolution, I'll probably come back to this.
Standards are only standards if they are followed. Urxvt does not read ~/.Xresources, it does read ~/.Xdefaults. I use ~/.Xdefaults and I never have to use xrdb to merge anything - it works with every program I've ever tried that uses a resource database.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Does LXDM not read the Xsession file in /etc/lxdm? Because that's got this section:
# Load resources for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do if [ -f "$file" ]; then echo "Loading resource: $file" xrdb -nocpp -merge "$file" fi done
No idea, I don't use it: but if your Xresources aren't being called, it would appear not.
Or, since that's a system-wide Xsession file, is it looking in /root for $HOME, rather than /home/<user>?
If that is the case is it as simple as putting[[ -f ~/.Xresources ]] && xrdb ~/.Xresourcesinto LXDM's /etc/lxdm/PostLogin script?
If yes, is that code correct? Shell scripting is on my ever-growing list of things to learn more about.
Give it a shot and report back.
Offline
I've spent a bit of time playing around with this and what ended up working was removing the -nocpp argument from this section of /etc/lxdm/Xsession:
# Load resources
for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do
if [ -f "$file" ]; then
echo "Loading resource: $file"
xrdb -nocpp -merge "$file"
fi
doneFrom the xrdb man page:
-nocpp This option indicates that xrdb should not run the input file through a pre‐processor before loading it into properties.
I also tried putting
[[ -f ~/.Xresources ]] && xrdb ~/.Xresourcesinto /etc/lxdm/PostLogin, which seems like it should have worked, but didn't.
Thanks very much for your help, guys.
Last edited by greggyb (2014-09-06 05:10:31)
Offline
Standards are only standards if they are followed. Urxvt does not read ~/.Xresources, it does read ~/.Xdefaults. I use ~/.Xdefaults and I never have to use xrdb to merge anything - it works with every program I've ever tried that uses a resource database.
From my understanding, ~/.Xdefaults and ~/.Xresources serve very different purposes: ~/.Xdefaults is read by X11 apps on startup, but only if they can't get values from the xrdb. The defacto standard for where to store the file you merge to xrdb is ~/.Xresources, which should *not* be read on startup.
Offline