Many customers, particularly those who are security conscious or those who have public terminals like to display a legal notice before users can login.
Randy Palmer, a dedicated support engineer for SUSE Linux Enterprise Desktop (SLED 10), writes in with this how-to. Thanks for this great article Randy!
This note will review how the Gnome login screen can be customized to incorporate a legal notice or to add an additional logo.
The format of the Gnome login screen (gdmgreeter) is governed by an xml file under /opt/gnome/share/gdm/themes/GDM-SuSE:
A659604:/opt/gnome/share/gdm/themes/GDM-SuSE # ls -l
total 492
-rw-r–r– 1 root root 255993 Dec 20 14:25 Background.jpeg
-rw-r–r– 1 root root 210 May 18 2007 GdmGreeterTheme.desktop
-rw-r–r– 1 root root 231 May 18 2007 dots.png
-rw-r–r– 1 root root 8081 Jan 7 11:47 industrial.xml
-rw-r–r– 1 root root 336 May 18 2007 n.png
-rw-r–r– 1 root root 738 May 18 2007 novell.png
-rw-r–r– 1 root root 17096 May 18 2007 screenshot.png
-rw-r–r– 1 root root 2511 May 18 2007 stripe.png
The filename of the xml file being used is referenced by the GdmGreeterTheme.desktop file under that directory:
A659604:/opt/gnome/share/gdm/themes/GDM-SuSE # grep Greeter GdmGreeterTheme.desktop
Greeter=industrial.xml
This default industrial.xml file is responsible for the arrangement of the elements on the gdm login screen. By editing this file, new elements can be added or existing elements repositioned. Be sure to make a backup copy of the industrial.xml file before editing it:
A659604:/opt/gnome/share/gdm/themes/GDM-SuSE # cp industrial.xml industrial.xml-bak
An additional logo can be displayed centered on the screen by specifying a new “pixmap” element referencing a logo graphic file:
<!– additional logo file –>
<item type=”pixmap”>
<normal file=”company_logo.png” alpha=”1″/>
<pos x=”50%” y=”17%” width=”550″ height=”258″ anchor=”c” />
</item>
A legal notice is added to center of the screen by specifying two new “label” elements with two lines of text comprising the desired legal notice:
<!– legal notice, 2 lines –>
<item type=”label” id=”legal-notice-line1″>
<pos x=”50%” y=”33%” anchor=”c” />
<normal font=”Sans Bold 16″ color=”#ffffff”/>
<text>Unauthorized access to or use of this system is prohibited.</text>
</item>
<item type=”label” id=”legal-notice-line2″>
<pos x=”50%” y=”36%” anchor=”c” />
<normal font=”Sans Bold 16″ color=”#ffffff”/>
<text>All access and use may be monitored or recorded.</text>
</item>
These new lines are inserted after the topright Novell logo and before the “timer” element:
<!– the Novell Logo topright –>
<item type=”pixmap”>
<normal file=”novell.png” alpha=”0.9″/>
<pos x=”-10″ y=”10″ width=”64″ height=”26″ anchor=”ne”/>
</item>
<!– additional logo file –>
<item type=”pixmap”>
<normal file=”company_logo.png” alpha=”1″/>
<pos x=”50%” y=”17%” width=”550″ height=”258″ anchor=”c” />
</item>
<!– legal notice, 2 lines –>
<item type=”label” id=”legal-notice-line1″>
<pos x=”50%” y=”33%” anchor=”c” />
<normal font=”Sans Bold 16″ color=”#ffffff”/>
<text>Unauthorized access to or use of this system is prohibited. </text>
</item>
<item type=”label” id=”legal-notice-line2″>
<pos x=”50%” y=”36%” anchor=”c” />
<normal font=”Sans Bold 16″ color=”#ffffff”/>
<text>All access and use may be monitored or recorded. </text>
</item>
<!– timer –>
<item type=”rect” id=”timed-rect”>
<show type=”timed”/>
<normal color=”#FFFFFF” alpha=”0.1″/>
<pos anchor=”c” x=”50%” y=”75%” width=”box” height=”box”/>
<box orientation=”vertical” min-width=”400″ xpadding=”10″ ypadding=”5″ spacing=”0″>
<item type=”label” id=”timed-label”>
<normal color=”#ffffff” font=”Sans 12″/>
<pos x=”50%” anchor=”n”/>
<!– Stock label for: User %s will login in %d seconds –>
<stock type=”timed-label”/>
</item>
</box>
</item
After saving the changes to the xml file, either find and kill the gdmgreeter process to allow it to restart:
A659604:/opt/gnome/share/gdm/themes/GDM-SuSE # ps -ef | grep gdmgreeter
gdm 1296 1271 0 12:09 ? 00:00:00 /opt/gnome/lib/gdm/gdmgreeter
root 11421 4563 0 12:10 pts/0 00:00:00 grep gdmgreeter
A659604:/opt/gnome/share/gdm/themes/GDM-SuSE # kill 1296
or simply restart the GUI in order to pick up the change and display the new elements on the Gnome login screen. You may need to adjust the “y” position of your additional elements to produce a pleasing display.
Another approach to displaying an additional logo or legal notice would be to simply recreate the default background image with the legal notice and additional logo embedded within the graphic file, as referenced here in the industrial.xml file:
<greeter>
<!– first we take care of the background stuff –>
<item type=”rect”>
<normal color=”#cccccc”/>
<pos x=”0″ y=”0″ width=”100%” height=”100%”/>
</item>
<item type=”pixmap”>
<normal file=”Background-with-additions.jpeg” alpha=”1″/>
<pos x=”0″ y=”0″ width=”100%” height=”100%”/>
</item>
But the advantage of adding the logo and text as separate elements is that the sharpness of the elements is preserved as the background image is stretched and scaled to fit the current monitor resolution. In a dual-monitor environment where the driver produces a single desktop displayed across both screens, the login dialog box and added elements appear centered on the gutter between the two monitors. These separate elements could then be shifted onto the left monitor only by adjusting their “x” position to 25%:
<!– additional logo file –>
<item type=”pixmap”>
<normal file=”company_logo.png” alpha=”1″/>
<pos x=”25%” y=”17%” width=”550″ height=”258″ anchor=”c” />
</item>
<!– legal notice, 2 lines –>
<item type=”label” id=”legal-notice-line1″>
<pos x=”25%” y=”33%” anchor=”c” />
<normal font=”Sans Bold 16″ color=”#ffffff”/>
<text>Unauthorized access to or use of this system is prohibited. </text>
</item>
<item type=”label” id=”legal-notice-line2″>
<pos x=”25%” y=”36%” anchor=”c” />
<normal font=”Sans Bold 16″ color=”#ffffff”/>
<text>All access and use may be monitored or recorded. </text>
</item>
<!– timer –>
<item type=”rect” id=”timed-rect”>
<show type=”timed”/>
<normal color=”#FFFFFF” alpha=”0.1″/>
<pos anchor=”c” x=”50%” y=”75%” width=”box” height=”box”/>
<box orientation=”vertical” min-width=”400″ xpadding=”10″ ypadding=”5″ spacing=”0″>
<item type=”label” id=”timed-label”>
<normal color=”#ffffff” font=”Sans 12″/>
<pos x=”50%” anchor=”n”/>
<!– Stock label for: User %s will login in %d seconds –>
<stock type=”timed-label”/>
</item>
</box>
</item>
<!– the login box contents, positioned freely –>
<item type=”rect”>
<pos y=”50%” x=”25%” width=”box” height=”box” anchor=”c”/>
<box ypadding=”5″ xpadding=”5″ spacing=”25″ orientation=”horizontal”>
Note also that, if desired, elements can be precisely located by specifying their exact position on the screen in pixels rather than a relative position using percentages.