Customizing the XDM Login Screen

How would you like your screen to look on start up? Here's how to make it look your way.
Changing the Background Pattern

A bitmap can be used to tile (copied over and over to cover the whole display) a simple two-color image onto the background instead of a solid color. There should be a collection of bitmaps in /usr/include/X11/bitmaps. You can also create your own using the bitmap program included with X windows. Try changing the xsetroot line to this:

/usr/X11R6/bin/xsetroot -bitmap\

Restart XDM as before, and you should now have a nice winter scene. You can change the foreground and background color with the bitmap by adding the -fg and -bg options and specifying a color. Try changing it to this:

/usr/X11R6/bin/xsetroot -bitmap\
/usr/include/X11/bitmaps/xsnow -fg blue -bg yellow
Not the most wonderful colors for snow, but you get the idea. The colors recognized by the -fg and -bg options are the same as the ones in the rgb.txt file discussed above.

You can also tile color bitmaps stored in the xpm format. The xpmroot program is used for this. Change the xsetroot line to something like this:

Displaying a Background Image

Now that we can display colors and tiled bitmaps on the background, it is time to display a picture on the background. To do this, I use a shareware graphics program called xv. You can get it from the xv home page at, or it may be included with your Linux distribution. Remember, this is shareware, and you should support the author by sending him $25 if you find his program useful.

I have chosen to use xv, but any program capable of displaying an image on the background can be used. For xv, you tell it to display the image centered on the background. You also want it to exit immediately after displaying the image; otherwise, XDM will hang until the xv program is exited manually.

/usr/X11R6/bin/xv -root -rmode 5 -quit\

I use this to put a picture in the center of the display. To view your changes, save the Xsetup file and press <H>ctrl<H>_<H>alt<H>-F7 to switch back to the XDM screen. Press <H>ctrl<H>-<H>alt<H>-<H>backspace<H> to restart the X server. You should now see your image in the center of the screen, covered by the login box. xv supports several other placement options using the -rmode command. You can see a list of these options by typing xv -rmode -1.

Displaying Random Images

Listing 1

With the help of a simple Perl script, you can display a random image on the background each time XDM is run. Listing 1 is a simplified version of a script written by Scott Scriven,

Type in this program or download it from and save it as /usr/local/bin/bkgd. Make sure execute permissions are set by typing:

chmod ugo+x /usr/local/bin/bkgd

You may also have to change the path to xv and find to match your local setup. Including the absolute paths in the script ensures it will work correctly, even when the $PATH environment variable isn't set.

To load a random background, change the xv line in Xsetup to usr/local/bin/bkgd instead. Create a /usr/lib/X11/backgrounds directory and fill it with your favorite images. A couple of good places to look for background images are and

Listing 2 is a working Xsetup file with the intermediate steps commented out with “#” characters.

Listing 2

Customizing the Login Box

Now we want to customize the xlogin box using the /usr/lib/X11/xdm/Xresources file. This file is also used for configuring other XDM widgets like the chooser, but we aren't going to deal with these other options here—see the XDM man page to learn about them.

We can move the xlogin box, resize it, change its color, its fonts and what it says. I have moved mine into the lower-right corner and made it as small as I can, so that it doesn't cover up the background image.

The XDM xlogin widget uses X resources to specify these settings. They are all stored in the Xresources file and are read by XDM each time it restarts. A list of the available options, taken from the XDM man page, is shown in “Xresources Options”. I will go through each option and explain its use.

I have ignored several more advanced xlogin resources, some of which may appear in the Xresources file. It is safe to leave them alone—the defaults set when you installed X should work fine. The XDM man page contains full descriptions of each option, if you want to experiment with them.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

XDM Greeter

Anonymous's picture

In Suse 10.3 (gnome), xdm displayed the login prompt in a tasteful and dignified rectangle. In Suse 11.1, it uses a picklist of users with a gnomeish graphic. How can I cause it to use the previous style?


SuSE 11.1 does not use xdm

Anonymous's picture

SuSE 11.1 does not use xdm by default, but gdm.
You can change this by editing the file
/etc/sysconfig/displaymanager - just replace the

Of course, the "right" way to do this is via YaST's
editor for /etc/sysconfig (found under "System").



Anonymous's picture

Cool, I couldn't find a sample/tutorial on XDM theming!
thanks for telling everyone which files do stuff with XDM, and the backgroun patten/image stuff was realy usefull!

do you know if/how you can define Alpha chanel (transparency) in objects - like the xlogin box for example?
do you know if XDM has a face/user browser that can be used for clicking on a user instead of typing a username, or will i have to hack XDM and past this feature from GDM for example?