[Xmonad] initialization when running xmonad using xnest

Michael Vanier mvanier at cs.caltech.edu
Fri Aug 3 17:09:00 EDT 2007


Huh, I think I was asking the wrong question then.  I don't really want to do all the things that 
are done in my .xinitrc file.  I noticed, though, that (for instance) my .Xresources are ignored 
inside the xnested xmonad, so I have to do

xrdb ~/.Xresources

again to get them to work right (presumably because xnest is running X on display 1, not 0). 
Similarly, I have to do "xsetroot -solid black" again to get a black background.  So I put these 
commands in my startup script like this:


#!/bin/sh

Xnest :1 -name "xmonad" +kb -ac -geometry 1152x768 2> /dev/null &
XNEST_PROC=$!
DISPLAY=:1

xsetroot -display :1 -solid black
xrdb -display :1 $HOME/.Xresources

/usr/local/bin/xmonad&
XMONAD_PROC=$!

wait $XMONAD_PROC
kill $XNEST_PROC


but the xrdb and xsetroot commands did nothing.  However, if I did it like this:


#!/bin/sh

Xnest :1 -name "xmonad" +kb -ac -geometry 1152x768 2> /dev/null &
XNEST_PROC=$!
DISPLAY=:1

/usr/local/bin/xmonad&
XMONAD_PROC=$!

xsetroot -display :1 -solid black
xrdb -display :1 $HOME/.Xresources

wait $XMONAD_PROC
kill $XNEST_PROC


it works fine.  I don't know why this is -- does xmonad have to be running in order for the xsetroot 
and xrdb commands to take effect?  Why should that be?

Mike


Stefan O'Rear wrote:
> On Thu, Aug 02, 2007 at 11:34:42PM -0700, Michael Vanier wrote:
>> I'm not ready to switch to using xmonad 100% of the time yet, so for the 
>> time being I'm running it using xnest.  The problem I'm having is that I 
>> don't know how to get xmonad (or xnest) to read an initialization file 
>> (e.g. a .xinitrc file) in these circumstances.  Does anyone have any 
>> suggestions?
> 
> Neither your window manager nor your X server is supposed to *ever*
> touch .xinitrc; this is the responsibility of your display manager, or
> if you do not use one, the server driver program.  For instance,
> untested:
> 
> startx -- /usr/bin/Xnest :1
> 
> will load your .xinitrc file in the context of an Xnest on display 1.
> 
> Stefan


More information about the Xmonad mailing list