Skip to content
Blog HOWTO create your own GDM Themes ( login screens )

HOWTO create your own GDM Themes ( login screens )


Create your own login screens in ubuntu..

Components of a GDM Theme

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 actual theme is defined. This file allows the declaration of frames, images, the login box, caps lock warning frame, background, icons, multi-language captions, etc.
* The GdmGreeterTheme.desktop file, which is not a true .desktop file, but it contains the name of the xml, screenshot and other information to be displayed in the GDM Configuration screen.

1. Create a theme directory…

$ mkdir mytheme
$ cd mytheme

2. Now copy the images to the directory and create a the xml file….

$ vi mytheme.xml

In general, the first item to be changed is the background image. The background image must be at least as big as the screen resolution. In order to make the theme suitable to other users, it is a good idea to use at least 1600×1200 pixel images, as they look sharp even on high-resolution screens. A small image can also be used, but it will loose quality when expanded. The image must be placed in the theme directory and declared in the 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 menus, 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 the following tags (respectively):

<item type=”pixmap”>
<item type=”rect”>
<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. Last, the xml file must be declared in the GdmGreeterTheme.desktop file as follows:

Greeter=theme.xml
A Sample mytheme.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE greeter SYSTEM "greeter.dtd">
<greeter>

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

<!-- ubuntu logo -->
<item type="pixmap">
<normal file="ceal.png" alpha="1.0"/>
<pos x="50%" y="33%" width="scale" height="18%" anchor="c"/>
</item>

<!-- bottom bar -->
<item type="pixmap">
<normal file="bottom_bar.png"/>
<pos y="100%" x="0" width="100%" height="100" anchor="sw"/>
</item>
<item type="rect">
<pos y="100%" x="0" width="100%" height="42" anchor="sw"/>
<box xpadding="10" spacing="10" orientation="horizontal">
<!-- reboot -->
<item type="rect" id="options_button" button="true">
<pos y="50%" width="box" height="box" anchor="w"/>
<box xpadding="0" spacing="2" orientation="horizontal">
<item type="pixmap">
<normal file="icon-session.png"/>
<prelight file="icon-session-prelight.png"/>
</item>
<item type="label">
<normal font="Sans 11" color="#ffffff"/>
<pos y="50%" anchor="w"/>
<stock type="options"/>
</item>
</box>
</item>
<!-- halt -->
<item type="rect" id="halt_button" button="true">
</item>
<!-- quit / disconnect -->
<item type="rect" id="disconnect_button" button="true">
</item>
</box>
</item>

<!-- hostname and clock -->
<item type="rect">
<pos x="100%" y="100%" width="box" height="42" anchor="se"/>
<box xpadding="10" spacing="10" orientation="horizontal">
<item type="label">
<pos x="100%" y="50%" anchor="e"/>
<normal font="Sans Bold 11" color="#ffffff"/>
<text>Customised by Dipin Krishna. College Of Engineering Attingal. %h //</text>
</item>
<item type="label" id="clock">
<pos x="100%" y="50%" anchor="e"/>
<normal font="Sans 11" color="#ffffff"/>
<text>%c</text>
</item>
</box>
</item>


<!-- password box -->
<item type="rect">
<pos x="50%" y="60%" width="box" height="box" anchor="c"/>
<box xpadding="0" ypadding="0" spacing="5" orientation="vertical">
<item type="pixmap">
<pos x="0" y="0" width="box" height="box"/>
<normal file="boundingbox.png"/>
<box xpadding="35" ypadding="15" spacing="10" orientation="vertical">
<item type="label" id="pam-prompt">
<pos x="0"/>
<normal font="Sans Bold 10" color="#ffffff"/>
<stock type="username-label"/>
</item>
<item type="pixmap">
<normal file="userentry.png"/>
<pos width="160" height="24"/>
<fixed>
<item type="entry" id="user-pw-entry">
<normal color="#000000" font="Sans 12"/>
<pos y="2" x="2" width="-4" height="-4" anchor="nw"/>
</item>
</fixed>
</item>
<!-- timer warning -->
<item type="label" id="timed-label">
<show type="timed"/>
<normal font="Sans Bold 11" color="#523921"/>
<stock type="timed-label"/>
</item>
</box>
</item>
<item type="rect">
<box xpadding="10" ypadding="8" spacing="10" orientation="horizontal" homogeneous="true">
<!-- language -->
<item type="rect" id="language_button" button="true">
</item>
<!-- session -->
<item type="rect" id="session_button" button="true">
</item>
</box>
</item>
</box>
</item>

<!-- caps lock warning -->
<item type="label" id="caps-lock-warning">
<pos x="50%" y="50%" anchor="c"/>
<normal font="Sans Bold 11" color="#dc292b"/>
<stock type="caps-lock-warning"/>
</item>


<!-- pam error -->
<item type="label" id="pam-error">
<pos x="50%" y="53%" anchor="c" />
<normal font="Sans Bold 11" color="#dc292b"/>
<text></text>
</item>

<!-- pam message (hidden, but required) -->
<item type="label" id="pam-message">
<pos x="50%" anchor="c" />
<normal alpha="0.00"/>
<text></text>
</item>

</greeter>

A Sample GdmGreeterTheme.desktop
[GdmGreeterTheme]Greeter=mytheme.xml
Name=HumanCeal
Description=Ubuntu Ceal Welcome Theme
Author=Dipin Krishna
Copyright=(c) 2009 GPL
Screenshot=screenshot.png

1 thought on “HOWTO create your own GDM Themes ( login screens )”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.