GdmThemeing
ContentsBRTableOfContents |
Work In Progress! |
- The intent of this page is to offer an explination of the various components in a Gnome Display Manager theme (also known as a gdm theme or a graphical greeter theme), as well as a basic tutorial of creating a theme, and tips for getting the most out of GDM features.
What is a GDM Theme?
- A GDM theme Is a collection of files that control the appearance of the Gnome Display Manager, refered to in short as the GDM.If you look in the /usr/share/gdm/themes/ directory, you can see the GDM themes that are already installed.
GDM Theme Components
- A GDM theme consists of around five components:
The .desktop file
Apparently, this is not a "true" .desktop file. I can neither confirm nor deny that fact. I can tell you that the GdmGreeterTheme.desktop file allows you to specify a name, creator, copyright information, a brief description, and the name of the preview image. This information is used by the GDM settings panel when listing your theme.
The Theme's XML file
- This is the file that tells the GDM what to display, how it should look, and where it will go. This is where we will be doing most of our work.
The Background Image
- This is fairly self explanitory. The background image is just like a wallpaper. Changing the background image is probably the most common change made to existing GDM themes. I know that's how I got started.
The Preview Image
- This, too, is fairly self-explanatory. The preview image is a picture of the theme in use, and is displayed in the GDM preferences window.
Any Foreground Images (Not Required)
- These are images that you use like icons in your theme. Common uses are for placing distro logos in the theme and to accompany or replace button label text.
The GdmGreeterTheme.desktop File
This is a skeleton for a GdmGreeterTheme.desktop file
[GdmGreeterTheme] Greeter= Name= Description= Author= Screenshot= Copyright=
The Theme's XML file
- This is a skeleton for an XML theme file.
<?xml version="1.0"?> <!DOCTYPE greeter SYSTEM "greeter.dtd"> <greeter> </greeter>
This portion of the XML file must remain unaltered. Everything that we can add or change will go in between the <greeter> and the </greeter> tags. If you want a quick explanation of the "rules" for XML, along with the basic vocabulary, I recommend reading [http://www.xml.com/pub/a/98/10/guide0.html?page=3 this] page on XML.com.
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>
Everything that we add to the skeleton XML file will appear, wither inside of, or in between <item> tags.
<pos/>
The <pos/> element is used to control the position and size of an item. The "x" and "y" attributes to give either exact pixel values, or percentages. the "height" and "width" attributes will also accept pixel or percentage based values.
<normal/>
The <normal/> element allows you to control the color, font, opacity and other features of certain items. The <normal/> element can often be used in conjunction with the <active/> and <prelight/> elements to change the apperance of an item when the mouse cursor is over it, and when it is actually clicking the item.
<stock/>
The <stock/> element is your best freind. Really. The stock element will display common labels in the systems prefered language. This takes all of the work out of making your gdm theme multilingual.
The Tutorial
- For much of this tutorial you will be required to write in files and directories that are in the /usr directory, so, you must be running in "superuser" mode. To do this you will need the root password, also known as the administrator password.
To make things easier here in the beginning, I have created a "skeleton" of a theme. No, it doesn't feature any bones, just all of the files necessary to act as a template for a GDM theme. You can download it GDMTheme.tar.gz here.
Tips
Box as a Size Value
Optimum Wallpaper Size
Preview Image Size
- "Officially" the preview image should be 200x150 pixels. If you use a larger inage, it will be scaled to 200x150 pixels when it is shown in the Login Manager preferences window. So while\there is no disasterous disadvantage to using a large preview image, it will increase the disk space that the theme occupies.
Backups
- There is no rule saying that you can't have extra files in your theme directory. If you are going to make changes that you are unsure about, or you are going to make lots of changes at once, make a copy of your XML file. If it your theme misbehaves, you can revert back to a pristine state.
Other Resources
- There are few tutorials (that I have found) for GDM themes on the web. Along with a basic understanding of XML, I found this site to be extreemly useful when I started writing GDM themes:
http://live.gnome.org/GnomeArt/Tutorials/GdmThemes - The home of the official Gnome Tutorial for GDM themes
Other Links
Gnome Display Manager Reference Manual - [http://www.5z.com/jirka/gdm-documentation/x1454.html Graphical Greeter Themes]
Reference Tables
item types
rect
box
label
entry
pixmap
svg
item ids
language_button
session_button
system_button
disconnect_button
clock
caps-lock-warning
timed-rect
timed-label
pam-prompt
user-pw-entry
pam-message
pam-error