[comp.windows.x] xdm root window

jim@fuji.eng.yale.edu (James J. Szinger) (01/25/91)

This should probably be a RTFM question, but I don't know which
of TM's to FR.  So, I would appreciate hints as how to change the
root window xdm displays.  Right now it's the default black and
white stipple pattern.  I'd like to get it to display colors and
bitmaps while displaying the login prompt.  xsetroot seems like a
good idea but the server doesn't respond until after xdm
relinqushes control to the user.  Peease send me e-mail to tell
me what I'm doing wrong.

Jim

rthomson@mesa.dsd.es.com (Rich Thomson) (01/26/91)

In article <JIM.91Jan25091218@fuji.eng.Yale.edu>
	jim@fuji.eng.yale.edu (James J. Szinger) writes:
>I would appreciate hints as how to change the root window xdm displays.

The black and white stipple pattern you see is a result of the server
resettting itself.  After a user's X session ends, there are no open
connections to the server and the server resets.  When it resets, it
paints the screen to this default background.

Now, when the login box comes back up, the server has been locked by
xdm.  In between those two would be a place where you would like to
have some command execute to tweak the background.  But there's a
problem.  If you put it in the Xreset script (which is run after the
user's session ends), it won't stay around because the script will
exit and the server will reset.

It really needs to be added as an (oh no! ;-) extra resource to xdm --
it should be a program to execute after the connection to the server
has been made (so the server won't reset) for the login box.  I heard
a rumor about some such resource in xdm at MIPS, but it isn't in the
generic MIT code.  I've thought about putting in this code (it
shouldn't be that hard), but is has some potential problems: what if
the command fails or never returns?  I guess this isn't too much of a
problem because the resources aren't set by users, but by the
sysadmin.

If anybody has a patch to the MIT xdm that does this, I'd like to have
a copy ;-}.

						-- Rich
-- 
  ``Read my MIPS -- no new VAXes!!'' -- George Bush after sniffing freon
	    Disclaimer: I speak for myself, except as noted.
UUCP: ...!uunet!dsd.es.com!rthomson		Rich Thomson
ARPA: rthomson@dsd.es.com			PEXt Programmer

alan@pivot.sbi.com (Alan Zeigler) (01/26/91)

In article <JIM.91Jan25091218@fuji.eng.Yale.edu>, jim@fuji.eng.yale.edu (James J. Szinger) writes:
> I'd like to get it to display colors and bitmaps while displaying 
> the login prompt.

This kludge doesn't entirely address your problem, i.e. you can't
display arbitrary bitmaps ala xsetroot, but it does allow you
to get a somewhat more pleasant background color on the xdm login
screen ...

I get a bit queazy looking at the default X stipple pattern so I
bumped the borderwidth of the xdm login window to cover the whole
screen.	 Here's the relevant chunk of my Xresource file:

	#ifdef				COLOR

	*background			: #cccccc
	*borderColor			: #40a0c0
	*foreground			: #000000
	*greetColor			: #000000
	*promptColor			: #000000
	*failColor			: #ff0000

	#endif				COLOR

	*borderWidth			: 400
	*geometry			: +-150+-100

The login window comes up grey on a blue "root" for my color machines
and white on black for my mono.	 One caveat, the geometry specification
is a bit hard-coded for my greeting message and for Sun frame buffer
dimensions (1152x900), so you'll have to diddle them a bit for your
setup (and get fancier with the #if's if your running in a hetero.
environment).  Hope it helps...
-- 
 Alan M Zeigler            | E-Mail: uunet!sbi!alan
 Salomon Brothers Asia Ltd | V-Mail: 1 212 747-9808
 2-2, Otemachi 2-chome     | Work:   81 3 5255-4483
 Chiyoda-ku, Tokyo 100     | FAX:    81 3 5255-5598

mouse@larry.mcrcim.mcgill.EDU (01/27/91)

> This should probably be a RTFM question, but I don't know which of
> TM's to FR.  So, I would appreciate hints as how to change the root
> window xdm displays.

(More text makes it clear he means the background to the login window.)

There is nothing that is obviously intended for this.  However, UTSLing
reveals that xdm uses xrdb to load resources just before creating the
login window and at no other time.  So, if you change your xdm-config
to run something else, that something else can set up the root
background.  For example, in xdm-config on one machine here I have

DisplayManager*xrdb:		/local/lib/X11/xdm/xrdb

where /local/lib/X11/xdm/xrdb is a shell script:

#! /bin/sh
# always called as $0 -display <disp> -load <file>
# we should parse the arglist, but not yet....
/local/bin/X11/xsetroot -solid black -display $2
/local/bin/X11/xrdb "$@"

This gives a solid black background for the login window (as one would
hope from the xsetroot arguments).

As the comments in the shell script imply, my example is very fragile:
it depends on xdm always running it with the arguments as commented
(determined by UTSLing).  I did this as an experiment to make sure it
works; if you are going to use this hack regularly I would definitely
urge you to have your replacement xrdb do a proper parse of its
argument list to figure out the display to use for the xsetroot (or
substitute).

X people, it might be nice to document this (or, preferably, provide a
somewhat less "magic" way of putting hooks before the login window is
popped up)....

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

pive@BANRUC01.BITNET (01/28/91)

A few months ago there was a simmilar discussion, this was one of the
answers (I kept it, but never tried it out) hopes this helps

Excerpts from X.varia: 2-Aug-90 Re: xsetroot in xdm? Keith
Packard@expo.lcs.m (905)

> > >
> > > Try to put the next command in the file /usr/lib/X11/xdm/Xreset:
> > > 	xsetroot -bitmap "filename"
> >
> > I have tried this before, but there was no result. Is there
> > any other way to change the background inbetween the xdm
> > sessions?

> The only place you can put xsetroot and get it to work is inside a shell scrip
> which runs as a replacement for xrdb (the name of which is configurable inside
> xdm-config).  You'll need to extract the display name from the argument list
> passed to xrdb (fixed in next release).  Here's an example:

> (/usr/lib/X11/xdm/xrdb+xsetroot)
> #!/bin/sh
> /usr/bin/X11/xrdb "$@"
> /usr/bin/X11/xsetroot -display $2 -bitmap /usr/include/X11/bitmaps/escherknot
> exit 0

> (add to /usr/lib/X11/xdm/xdm-config)
> DisplayManager*xrdb:	/usr/lib/X11/xdm/xrdb+xsetroot

> No, I haven't tested this exact script, but I have run similar scripts quite
> successfully.

> Keith Packard
> MIT X Consortium




P. Verhaeghe
University of Antwerp, RUCA
Algebra / Geometry
Groenenborgerlaan 171
B-2020 Antwerpen, Belgium

Tel: +32 3 2180308
Fax: +32 3 2180217
Telex: RUCABI 33362

E-mail: pive@banruc01.bitnet (or pive@ccu.uia.ac.be)

stumpf@Informatik.TU-Muenchen.DE (Markus Stumpf) (01/28/91)

In article <1991Jan26.001505.29420@dsd.es.com>, rthomson@mesa.dsd.es.com (Rich Thomson) writes:
|> It really needs to be added as an (oh no! ;-) extra resource to xdm --
|> it should be a program to execute after the connection to the server
|> has been made (so the server won't reset) for the login box.  I heard
|> a rumor about some such resource in xdm at MIPS, but it isn't in the
|> generic MIT code.  I've thought about putting in this code (it
|> shouldn't be that hard), but is has some potential problems: what if
|> the command fails or never returns?  I guess this isn't too much of a
|> problem because the resources aren't set by users, but by the
|> sysadmin.
|> 
|> If anybody has a patch to the MIT xdm that does this, I'd like to have
|> a copy ;-}.

You don't need a patch! It's already there, even if it's kind of a _hack_:
If used the following to display xmas-bitmaps: (of course you have to be
root/have write acces to the files/directories)

in /usr/lib/X11/xdm (default directory for xdm configs)

change/add the line in xdm-config:

DisplayManager*xrdb:           /usr/lib/X11/xdm/xrdb+xsetroot


make the file /usr/lib/X11/xdm/xrdb+xsetroot to look like e.g.:

#!/bin/sh
#
# load the resources and change the root-window background pixmap
#

/usr/bin/X11/xrdb "$@"

echo "setting root background" >> /usr/lib/X11/xdm-errors
/usr/bin/X11/xsetroot -display $2 -bitmap /usr/wiss/stumpf/bitmaps/xmastree.xbm
exit 0


To really get it to work, you have to kill all xdms and restart xdm!

	\Maex

-- 
+- Markus Stumpf                         Technische Universitaet Muenchen   -+
|                            Institut fuer Informatik, Rechnerbetriebsgruppe |
|  stumpf@informatik.tu-muenchen.de              Postfach 202420             |
+-   ...@{unido.uucp,relay.cs.net}        D-8000 Muenchen 2, West Germany   -+