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.
Move and Resize the xlogin Box

The .width, .height, .x and .y settings can be used to set the size and screen position of the xlogin box, or you can use .geometry to specify all of these at once. Let's move the login box to the lower-right corner and make it 300 by 250 pixels. The screen coordinates to be used start with 0,0 in the upper-left corner, and the coordinates of the lower-right corner will depend on your screen resolution. But X has another way to specify coordinates: -0,-0 is the lower-right corner of the display, no matter what the screen size. Add this line to the Xresources file, near the other xlogin* definitions:

xlogin*geometry: 300x250-0-0

Save the file and restart the x server as you did after changing the background image. Your login box should now fit snugly into the lower-right corner of the display, revealing more of your background image.

Now we can change the colors. There are five resources relating to color in the above table. First, change the default foreground and background colors for the box using the xlogin*foreground and .background settings. Let's make it black on blue:

xlogin*foreground: black
xlogin*background: steelblue

Save and restart the X server to make sure your changes have taken effect. The greeting and login prompt did not change color, because you haven't changed them yet. You must specify each individual color you want to change. The .greetColor setting is the greeting that is displayed at the top of the box. .promptColor is the login: and password: prompt color, as well as the text you enter for your user name. .failColor is used for when the user name or password entered is invalid.

Try out these settings:

xlogin*foreground:  black
xlogin*background:  steelblue
xlogin*greetColor:  white
xlogin*promptColor: grey
xlogin*failColor:   red

Not a terribly inspiring color scheme, but better than black on white. Play around with it until you find the colors you like.

Changing the xlogin Fonts

The resources that control the four fonts we want to change are:

  • xlogin*font: used for displaying the typed-in user name

  • xlogin*greetFont: used to display the greeting

  • xlogin*promptFont: used to display the prompts username: and password:

  • xlogin*failFont: used for displaying that the login failed

Fonts under X are difficult to deal with. They have an abundance of options and modifiers, most of which are never used. The xfontsel program can make font selection much easier. Just browse through the fonts, selecting the font style, size and attributes you want. Then click on the select button and paste the font string into the Xresources file using your middle mouse button, or both mouse buttons at once if you have a two-button mouse. Add these lines to your Xresources file:

xlogin*font:\
 -*-courier-bold-r-*-*-18-*-*-*-*-*-*-*
xlogin*greetFont:\
 -*-helvetica-bold-r-*-*-24-*-*-*-*-*-*-*
xlogin*promptFont:\
 -*-lucidatypewriter-bold-r-*-*-18-*-*-*-*-*-*-*
xlogin*failFont:\
 -*-times-bold-i-*-*-24-*-*-*-*-*-*-*
Experiment with the different fonts and sizes until you find something you like.

Changing the xlogin Prompts

You can also specify the text that is displayed for each of the four prompts associated with the xlogin widget. .greeting can be set to CLIENTHOST and will display the full host name of the system it is running on. The .namePrompt value is displayed to ask for the user name, .passwdPrompt asks for the password, and .fail is displayed when an unsuccessful login occurs. For example:

xlogin*greeting:         Welcome!
xlogin*namePrompt:       Name:\040
xlogin*passwdPrompt:     Password:
xlogin*fail:             !WRONG!
Add a Clock to Your XDM Screen

X distributions usually include the xclock program which can display a nifty looking analog clock. Add it to your XDM screen by inserting this line in your Xsetup file:

xclock -hl white
-hd white -bg black -fg white\ -geometry 100x100+0+0 &

This will display an analog clock of moderate size in the upper-left corner of the screen. The clock may stay running, even after a user has logged in.

Well, that's about it for the basic customization of XDM. There are many things to play with, and hopefully I have given you a good framework with which to begin experimenting. No two users have the same tastes, so it may take some time before you finally get the look and feel you want.

Xresources Options

Brian Lane and his wife Denise live in Olalla, Washington with their four computers. He spends his days developing embedded software and his nights writing Linux code. He can be contacted at nexus@tatoosh.com.

______________________

Comments

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?

Thanks

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
line DISPLAYMANAGER="gdm" by DISPLAYMANAGER="xdm".

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

HTH.

XDM

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?

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState