Creating GDM Themes mini HOWTO      2003.12.06 @ 9:09:38 PM
I have received a few emails lately asking me how to create a GDM theme. I really do not know much about it, but I can tell you it isn't rocket-science. A GDM Theme is basically composed by:

- A background image
- A screenshot to be displayed in the GDM Configuration
- Icons (images for the icon bar)
- An xml file, where the whole enchilada is defined. Here you can draw frames and images and position the login box, caps lock warning frame, background, icons, captions in all languages, etc.
- The GdmGreeterTheme.desktop file, which is not a true .desktop file, but it contains the name of the xml, screenshot and other info to be displayed in the GDM Configuration screen

I strongly encourage you to start with an existing theme, rather than trying to figure it out by yourself. The first thing you will want to change is the background image, using a picture that is big enough to fit your screen. I always use at least 1600x1200 pixel images, a they look sharp even on high-resolution screens. You can also use a small image, but it will loose quality when expanded to fit the screen. Place the image file on your theme directory and declare it on your xml file as follows:

<item type="pixmap">
<normal file="background.jpg"/>
<pos x="0" y="0" width="100%" height="0"/>
</item>

Next you will have to reposition your prompts menues, labels and icons in order to match your background image. Even though you can make it all transparent, a centered login box might not always the best choice.

You can define images, rectangles and labels with "<item type="pixmap"> type="rect">" and "<item type="label">". Using the "item" tag, you can also specify the location of option buttons, system messages, login screen, etc, by adding "id=" to the item tag. All the GDM system tags I am aware of are:

<item type="rect" id="language_button" button="true">
<item type="rect" id="session_button" button="true">
<item type="rect" id="system_button" button="true">
<item type="rect" id="disconnect_button" button="true">
<item type="label" id="clock">
<item type="rect" id="caps-lock-warning">
<item type="rect" id="timed-rect">
<item type="label" id="timed-label">
<item type="label" id="pam-prompt">
<item type="entry" id="user-pw-entry">
<item type="label" id="pam-message">
<item type="label" id="pam-error">

Use the "pos" tag within each "item" section to define its x,y position and make sure it all looks in harmony with your background image and declare your xml file in the GdmGreeterTheme.desktop file as follows:
Greeter=theme.xml

Once you theme is done, you will need a screenshot. This part is a bit tricky as you have already logged off and do not have access to The Gimp o any other graphical screen capture application. You'll use import as explained in this article: http://julian.coccia.com/article-29.html. (import is part of the ImageMagick package)

Now put the screenshot in your theme directory and make a reference to it in your GdmGreeterTheme.desktop, adding also your author, name, description and copyright fields as follows:
[GdmGreeterTheme]
Greeter=theme.xml
Name=Coliseo
Description=Il Coliseo, night shot by http://julian.coccia.com
Author=Julian Coccia
Screenshot=Coliseo.jpg
Copyright=Copyright (C) 2003, Julian Coccia

Last, all you have to do is a gzipped tarball with tar -zcf MyTheme.tar.gz MyThemeDir and presto!. It can be now easily installed on any computer from the GDM Configuration Screen.

All knowledge and software published in this website is released under the GNU General Public License (GPL)