Work In Progress!

Contributions welcomed!

Currrent Status

Adding Content 70%

What is a GDM Theme?

GDM Theme Components

The .desktop file

<pos x="50%" y="33%" width="scale" height="15%" anchor="c"/>

The Theme's XML file

The Background Image

The Preview Image

Any Foreground Images (Not Required)

The GdmGreeterTheme.desktop File

[GdmGreeterTheme]
Greeter=
Name=
Description=
Author=
Screenshot=
Copyright=

The Theme's XML file

<?xml version="1.0"?>
<!DOCTYPE greeter SYSTEM "greeter.dtd">
<greeter>
</greeter>

Available Theme Elements

These are all of the elements that will be used for the tutorial theme. More information on each element is available in the tutorial and in the reference tables at the end of this page.

<item></item>

<pos/>

<normal/>

<stock/>

The Tutorial

Phase One: The Setup

Phase Two: The Beginning

Step One

Step Two

Step Three

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

<item type="pixmap">

<normal file="background.png"/>

<pos x="0" y="0" width="100%" height="100%"/>

</item>

Step Four

<item type="entry" id="user-pw-entry">
<pos y="50%" x="50%" width="10%" height="20" anchor="c"/>
</item>

If you save your work, you can set GDM to use this theme in your Login Window preferences and log out to see your progress so far. It's not very friendly, but it is functional.

Phase Three: Enhancing Usability

In the last phase we created the bare minimum of a functional theme, but not a very helpful one. you can enter the username and password, but there is no feedback as to the current state or for any errors. So in this phase we will be improving it's current state of usability.

Step One

<pos anchor="n" x="50%" y="50%" height="20" width="20%"/>  

Step Two

<item type="label" id="pam-prompt">
 <pos anchor="s" x="50%" y="50%"/>
 <normal font="Bitstream Vera Sans Bold 10" color="#ffffff"/>
 <stock type="username-label"/>
</item>

Step Three

<item type="label" id="pam-error">
 <pos x="50%" y="-10" anchor="s" />
 <normal font="Bitstream Vera Sans Bold 10" color="#ffffff"/>
 <text></text>
</item>

Step Four

<item type="label" id="timed-label">
 <pos x="50%" y="10" anchor="n"/>
 <show type="timed"/>
 <normal font="Bitstream Vera Sans Bold 10" color="#ffffff"/>
 <stock type="timed-label"/>
</item>

Step Five

<item type="rect" id="options_button" button="true">
 <pos x="-1" y="-1" anchor="se" width="box" height="box"/>
 <box>
  <item type="label">
   <normal color="#ffffff" font="Bitstream Vera Sans 10"/>
   <stock type="options"/>
  </item>
 </box>
</item>

Phase Four: Beautify

Phase Five: Packaging

In the last stage we put the finishing touches on our theme's appearance. For our final phase, we are going to add some final additions to make our theme complete and package it to be distributed and installed.

Step One

sudo apt-get install imagemagick

Step Two

echo "chvt 7 ; sleep 5 ; XAUTHORITY=/var/gdm/:0.Xauth DISPLAY=:0.0 import -window root /tmp/screenshot.png" > /tmp/capture

Step Three

Ubuntu 6.06.1 LTS You-Desktop tty1

You-Desktop Login:_

sh /tmp/capture

and wait while the imagemagick works. The screen should change to your GDM theme, and then about five seconds later, beep. After that, it is safe to log back in to the GDM theme. If you are using a timed login, you may need to turn it off or adjust the timeout to actually get the shot.

Step Four

You will now have to add this to the GdmGreeterTheme.desktop file, As root, open it in a text editor, and Change the screenshot line so it reads:  Screenshot=screenshot.png 

Step Five

If you just wanted to create a theme for your own use, you are done. But if you ever decide to share your work with others, this last step will help you package your theme so that it can be distributed and installed easily by others. To do this, just open up your terminal, and type:

cd /usr/share/gdm/themes/
tar -zcf GDMTheme.tar.gz GDMTheme

Your packaged theme will be the file GDMTheme.tar.gz in the /usr/share/gdm/themes/ directory.

Tips

Box as a Size Value

Optimum Wallpaper Size

Preview Image Size

Backups

Reference Tables

Item Types

Item

Type

entry

A text entry field.

list

A list widget.

label

A text label. This item must contain a text or stock element.

pixmap

A pixmap image. Use a normal element inside of the item element to give image file name.

rect

Draws a rectangle. Use the normal element to describe appearance.

svg

An SVG image. Use a normal element inside of the item element to give image file name.

Item Ids

Id

Description

Buttons

Buttons can be used with the rect item type. They require the additional item attribute of button="true" to function.

language_button

Opens the language menu.

session_button

Opens the session menu.

system_button

Opens the system menu.

disconnect_button

Disconects from a remote login.

clock

Used with the label id clock to display a constantly updated time

caps-lock-warning

Displays a warning when caps-lock is on.

timed-rect

Used in conjunction with the timed-label label id.

timed-label

Used in conjunction with the timed-label label id.

pam-prompt

Displays a prompt fo the username and password.

user-pw-entry

The username and password entry field. Requires an item type of entry.

userlist

Displays a list of usernames and photos. Requires an item type of list.

pam-message

Displays a verbose prompt fo the username.

pam-error

Displays an error on failed login

Label Ids

id

Description

clock

Displays the date and time.

pam-prompt

Displays a friendly prompt for the username, password, etc..

pam-error

Displays login errors.

pam-message

Displays messages about the state of an account

timed-label

Displays a message describing automatic login. This item should always encapsulate a element of show with the attribute type="timed".

Stock Types

Type

Description

caps-lock-warning

displays a warning if your caps lock is on.

chooser

Displays a label for the chooser_button.

disconnect

Displays a label for the disconnect_button.

halt

Displays a label for the halt_button.

language

Displays a label for the language_button.

quit

Quits GDM when attempting a second login.

reboot

Displays a label for the reboot_button.

session

Displays a label for the session_button.

suspend

Displays a label for the suspend_button.

system

Displays a label for the system_button.

timed-label

Displays "USERNAME will login in NUMBER seconds" when a timed login is used.

username-label

Displays a username prompt, and once the username is entered, it changes to a password prompt.

welcome-label

Displays the system welcome message, which can be configured in the Login Window preferences panel.

Normal/Active/Prelight Attributes

color

Accepts hex colors with a preceding hash (#) mark. When placed inside of a rect item, it gives the background color. When placed inside of a label item, it gives the font color.

alpha

Specifies the opacity: fully opaque would have a value of 0.0; fully transparent, a value of 1.0. If the alpha tag is not used, 0.0 is assumed.

font

Specifies the font and font size for label items. Text can also be made bold and/or italic. Example: font="Sans Bold Italic 12"

file

Specifies the file name for an image in pixmap and svg items. Relative pathnames are assumed to be in the same directory as the theme .xml file

tint

Specifies a tint color in hex. This will tint an image when it is encapsulated by a pixmap item. This is extremely useful when used with the active and prelight elements.

Show types

chooser

Show if the chooser button is enabled.

config

Show if the configuration is enabled.

halt

Show if halt is enabled.

reboot

Show if Reboot is enabled.

suspend

Show if suspend is enabled.

system

Show if system is enabled.

timed

Show if a timed login is enabled.

Show modes

Multiple modes

You can list more than one mode by separating them with commas

console

Show in console mode.

console-fixed

Show in console non-flexi mode.

console-flexi

Show in console & flexi mode.

flexi

Show in flexi mode.

remote

Show in remote mode.

remote-flexi

Show in remote & flexi mode.

Other Resources

Comments

Artwork/Incoming/Attic/GdmThemeing (last edited 2008-08-06 17:00:08 by localhost)