Basic xdm customization

You may wish to personalize the look of xdm for your system. The look of the graphical login screen can be altered by manipulating the resources in /etc/X11/xdm/Xresources. (Note that Xresources uses ! to start comments.) For example, the following excerpt shows settings to control the greeting (Welcome to Linux on smp-pc), other prompts, and colors:

! Xresources file
xlogin*borderWidth: 10
xlogin*greeting: Welcome to Linux on CLIENTHOST
xlogin*namePrompt: Login:\040
xlogin*fail: Login incorrect - try again!
xlogin*failColor: red
xlogin*Foreground: Yellow
xlogin*Background: MidnightBlue

You can also include command-line options to the X server in /etc/X11/xdm/Xservers if you wish to override those found in /etc/X11/xorg.conf. For example, to change the default color depth, add the -bpp (bits per pixel) option for the local display:

# Xservers file
:0 local /usr/X11R6/bin/X -bpp 24

To include additional X programs or settings on the graphical login screen, put them in /etc/X11/xdm/Xsetup_0. In this example, the background color of the X display is set to a solid color (in hexadecimal form), and a clock is added at the lower-righthand corner of the screen:

#!/bin/sh
# Xsetup
/usr/X11R6/bin/xsetroot -solid "#356390"
/usr/X11R6/bin/xclock -digital -update 1 -geometry -5-5 &

Note that in this example, xsetroot exits immediately after it sets the color, allowing the Xsetup_0 script to continue. xclock, however, does not exit and must be put into the background using ...

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.