Skip to main content

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 1600x1200 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

Comments

Anonymous said…
nice post end thanks, now iĺl do my own them. :)

Popular posts from this blog

Howto Install BSNL wll clarity phone in Ubuntu

Hello linixians, Failed to access internet through your bsnl clarity phone.... Here is an easy way 1. Just download this executable..... bsnlclarity and save it to your home folder. 2. Connect your phone to the system with the usb cable. 3. Now at terminal type $ sudo ./bsnlclarity You will be asked for your username and password for accessing the internet enter it ..... now start surffing Ctrl+C to stop

Blank (or black) screen after boot process in Ubuntu

You may encounter a blank screen after boot in ubuntu. This will be due to some update of certain packages. Follow these steps to correct the problem. 1. Select recovery mode from the boot menu. 2. Select login as root from the menu in recovery mode. 3. Type this at the prompt # sudo apt-get remove xorg-driver-fglrx # sudo dpkg-reconfigure -phigh xserver-xorg 4. Exit # exit 5. Now select Resume normal boot from the menu. Every thing should be OK by now. Please comment about your experience.

gtalx: Howto Gtalk in ubuntu ( google talk )

Did you fail to use " gtalk in ubuntu " ... Now you can chat and talk to your gmail buddies in ubuntu... 1. check for gtk2.0 and qt4 $ sudo apt-get install libgtk2.0-dev $ sudo apt-get install libqt4-dev libogg-dev libtheora-dev $ sudo apt-get install libsdl-dev libavcodec-dev libswscale-dev $ sudo apt-get install libexpat-dev libraw1394-dev libvorbis-dev $ sudo apt-get install libgsm1-dev  libspeexdsp-dev libmediastreamer0-dev libortp-dev 2. Remove 'pulse audio sound server' Open synaptic package manager and remove pulse audio 3. "Download gtalx" from here Dowload it here 4. Extract the file.... $ tar -zxvf 0.0.4.tar.gz 5. Get into the directory.... $ cd 0.0.4 and then... $ sudo chmod u+x make $ ./make $ sudo ./make install 6. Enjoy..... Please comment about your installation(whether it was a success or not....) Take gtalx from Applications > Internet > gtalx Enter your gmail login information..and click connect...