Personal tools
     DOCUMENTATION

User:StephanieWatson

From rPath Wiki

Jump to: navigation, search

Contents

I am a technical writer at rPath with extensive experience in technical training and writing for Linux. I'm one of the contributors and maintainers for wiki.rpath.com content and the rPath Wiki appliance, and I work toward the rPath Documentation goal of providing easy-to-use documentation for new users, end users, system administrators, and developers.

stefw in #rpath-support, #conary, and #foresight on FreeNode IRC

Personal Projects

Part of being a good technical writer is to be as close as possible to an expert in the subject matter. If there are questions I encounter as a new user, I first pursue as thorough an answer as I can find from subject-matter experts, and then I write down what I've learned in a way to instruct others who have yet to learn.

As part of learning Conary and rPath technologies, I became excited to package software and create appliances for myself and for software I believe in. I'm also crazy about customizing the look-and-feel of my Linux experience. All this enthusiasm has inspired me toward the following projects:

GDM Login Development

This section includes some instructions for creating and using a GDM Login screen. I have been developing them for Conary-based appliances based on rPath Linux and Foresight Linux, so instructions will include packaging information for Conary.

UPDATE: My foresight-gdm-login-simple-green package was accepted as the default theme for Foresight in Spring 2007. YAY! \o/

Image:Bulbgraph.png   I have had no experience with XML up to this point except to adapt others' code. If there are changes or additions I can make to better conform to XML concepts, please let me know.

Create the Graphic

Create a graphic that is the appropriate dimensions for the login screen. For mine, I used Inkscape, available in Foresight Linux, to create a scalable vector graphic which exported to a png file.

Create the Files

The GDM Login requires four files:

  • Background image file (mine was 1600x1200)
  • Small screenshot for the GDM Login choosing utility (mine was 750x600)
  • GdmGreeterTheme.desktop with summary information about the theme
  • Gnome.xml with all the code necessary to prompt for credentials and provide feedback

These files reside in a directory that imitates the name of the theme. In Foresight and rPath Linux, the GDM Login theme directories are located in /usr/share/gdm/themes.

I started development by copying and modifying the files from other GDM Login themes. I spent a lot of time working with the XML to learn how the code worked; resources online are very limited, and my goal in writing about my work is to create a better resource for others who may be working on their own login themes.

XML Stuff

These lines are at the top of each of my files. I haven't yet determined what the DOCTYPE line references:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE greeter SYSTEM "greeter.dtd">

Geometry

This section describes the tags and options as I have worked with them in the XML files. I have noted the behavior of each as I have observed them and learned from other resources.

The pos tag appears to be a call to position an item. The options within it seem to correspond to the geometry in X, except that positioning is relative to the item's container:

  • x - horizonal position
  • y - vertical position
  • height
  • width
  • anchor - the point on the object that is used to make the position adjustments; I've used "center" more than any other value here

In the box tag:

  • xpadding
  • spacing
  • orientation
<!-- hostname -->
<item type="rect">
    <pos x="75%" y="60%" width="box" height="35" anchor="center"/>
    <box xpadding="10" spacing="10" orientation="horizontal">
            <item type="label">
                <pos x="50%" y="0%" anchor="center"/>
                <normal font="Sans Bold 9" color="#ffffff" alpha="0.5"/>
                <text>%h</text>
            </item>
    </box>
</item>

Variables and Stock Stuff

These are the variables I've been working with in the XML files:

  • %h - hostname
  • %c - clock (date and time)
  • %s and %d - Timed login variables, such as in, "User %s will log in in %d seconds."

The following stock item types have been included in each of my themes:

  • username-label
  • language
  • session
  • system
  • disconnect
  • quit

Each of these are included in an item using the stock tag:

<stock type="quit"/>

Package the Theme

Create a compressed tar file (tgz) of the theme directory, and use a Conary package recipe to install the theme on a Conary-based system. I packaged the "simple green" theme for Foresight Linux using the following recipe, which can be adapted to fit any theme and package name:

 
# Foresight GDM Login Simple Green (GDM login theme)
#
# Copyright (c) 2007 rPath, Inc.
# This file is distributed under the terms of the MIT License.
# A copy is available at http://www.rpath.com/permanent/mit-license.html
#
 
class ForesightGdmLoginSimpleGreen(PackageRecipe):
    name = 'foresight-gdm-login-simple-green'
    version = '1.0'
 
    def setup(r):
        # defining a macro for the GDM theme directory
        r.macros.gdmthemedir = '%(datadir)s/gdm/themes'
        # add the theme to the theme directory
        r.addArchive('%(name)s.tgz', dir='%(gdmthemedir)s/')

See Conary:Packager for additional references for Conary packaging, or step through the New Package Tutorial if this is your first Conary packaging experience.