[24267] in Source-Commits
/svn/athena r23865 - in trunk/debathena/debathena: . kiosk kiosk/debian kiosk/images kiosk/styles
daemon@ATHENA.MIT.EDU (Robert A Basch)
Wed Jun 17 16:08:46 2009
Date: Wed, 17 Jun 2009 16:08:30 -0400
From: Robert A Basch <rbasch@MIT.EDU>
Message-Id: <200906172008.n5HK8UD3002033@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: rbasch
Date: 2009-06-17 16:08:30 -0400 (Wed, 17 Jun 2009)
New Revision: 23865
Added:
trunk/debathena/debathena/kiosk/
trunk/debathena/debathena/kiosk/debian/
trunk/debathena/debathena/kiosk/debian/changelog
trunk/debathena/debathena/kiosk/debian/compat
trunk/debathena/debathena/kiosk/debian/control.in
trunk/debathena/debathena/kiosk/debian/copyright
trunk/debathena/debathena/kiosk/debian/debathena-kiosk.dirs
trunk/debathena/debathena/kiosk/debian/debathena-kiosk.install
trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postinst
trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postrm
trunk/debathena/debathena/kiosk/debian/rules
trunk/debathena/debathena/kiosk/images/
trunk/debathena/debathena/kiosk/images/debathena-icon.png
trunk/debathena/debathena/kiosk/images/debathena-owl-100.png
trunk/debathena/debathena/kiosk/index.html
trunk/debathena/debathena/kiosk/launch-kiosk
trunk/debathena/debathena/kiosk/prefs.js
trunk/debathena/debathena/kiosk/r-kiosk.xpi
trunk/debathena/debathena/kiosk/styles/
trunk/debathena/debathena/kiosk/styles/layout.css
trunk/debathena/debathena/kiosk/styles/style.css
trunk/debathena/debathena/kiosk/userChrome.css
trunk/debathena/debathena/kiosk/xinitrc
Log:
Add the debathena-kiosk package.
Added: trunk/debathena/debathena/kiosk/debian/changelog
===================================================================
--- trunk/debathena/debathena/kiosk/debian/changelog 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/changelog 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,5 @@
+debathena-kiosk (1.0) unstable; urgency=low
+
+ * Initial release.
+
+ -- Robert Basch <rbasch@mit.edu> Wed, 17 Jun 2009 15:17:59 -0400
Added: trunk/debathena/debathena/kiosk/debian/compat
===================================================================
--- trunk/debathena/debathena/kiosk/debian/compat 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/compat 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1 @@
+4
Added: trunk/debathena/debathena/kiosk/debian/control.in
===================================================================
--- trunk/debathena/debathena/kiosk/debian/control.in 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/control.in 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,16 @@
+Source: debathena-kiosk
+Section: debathena/web
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.7.2
+
+Package: debathena-kiosk
+Architecture: all
+Depends: ${misc:Depends}, firefox | iceweasel, metacity, unzip
+Description: Starts a kiosk mode web browser on a new virtual terminal
+ This package provides a tool to launch a separate X11 session, running
+ a kiosk mode web browser, on a new virtual terminal. It is most useful
+ when configured to be invoked as a custom command from gdm, to enable
+ functions such as registering for an Athena account from a pre-login
+ environment.
Added: trunk/debathena/debathena/kiosk/debian/copyright
===================================================================
--- trunk/debathena/debathena/kiosk/debian/copyright 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/copyright 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,18 @@
+The Athena source code was obtained from the Athena SVN repository at
+<svn://debathena.mit.edu/athena/trunk>, and is licensed as follows:
+
+ Copyright © 2009 by the Massachusetts Institute of Technology.
+
+ Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and
+ that both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of M.I.T. not be used in
+ advertising or publicity pertaining to distribution of the software
+ without specific, written prior permission. M.I.T. makes no
+ representations about the suitability of this software for any
+ purpose. It is provided "as is" without express or implied
+ warranty.
+
+The Debian packaging is Copyright © 2009 Massachusetts Institute of
+Technology, and has the same license as the original software.
Added: trunk/debathena/debathena/kiosk/debian/debathena-kiosk.dirs
===================================================================
--- trunk/debathena/debathena/kiosk/debian/debathena-kiosk.dirs 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/debathena-kiosk.dirs 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1 @@
+usr/lib/debathena-kiosk
Added: trunk/debathena/debathena/kiosk/debian/debathena-kiosk.install
===================================================================
--- trunk/debathena/debathena/kiosk/debian/debathena-kiosk.install 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/debathena-kiosk.install 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,8 @@
+index.html usr/lib/debathena-kiosk
+launch-kiosk usr/lib/debathena-kiosk
+prefs.js usr/lib/debathena-kiosk
+r-kiosk.xpi usr/lib/debathena-kiosk
+userChrome.css usr/lib/debathena-kiosk
+xinitrc usr/lib/debathena-kiosk
+images usr/lib/debathena-kiosk
+styles usr/lib/debathena-kiosk
Added: trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postinst
===================================================================
--- trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postinst 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postinst 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,44 @@
+#!/bin/sh
+# postinst script for debathena-kiosk
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ # Add the kiosk user.
+ user=kiosk@mit
+ if ! getent passwd $user >/dev/null; then
+ adduser --system --force-badname $user
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Property changes on: trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postinst
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postrm
===================================================================
--- trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postrm 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postrm 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,44 @@
+#!/bin/sh
+# postrm script for debathena-kiosk
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge)
+ user=kiosk@mit
+ if getent passwd $user >/dev/null; then
+ deluser --system --remove-home $user || true
+ fi
+ ;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Property changes on: trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postrm
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/debathena/debathena/kiosk/debian/rules
===================================================================
--- trunk/debathena/debathena/kiosk/debian/rules 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/debian/rules 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,3 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
Property changes on: trunk/debathena/debathena/kiosk/debian/rules
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/debathena/debathena/kiosk/images/debathena-icon.png
===================================================================
(Binary files differ)
Property changes on: trunk/debathena/debathena/kiosk/images/debathena-icon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/debathena/debathena/kiosk/images/debathena-owl-100.png
===================================================================
(Binary files differ)
Property changes on: trunk/debathena/debathena/kiosk/images/debathena-owl-100.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/debathena/debathena/kiosk/index.html
===================================================================
--- trunk/debathena/debathena/kiosk/index.html 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/index.html 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<title>Debathena</title>
+<link rel="stylesheet" href="styles/style.css" type="text/css" />
+<link rel="stylesheet" href="styles/layout.css" type="text/css" media="screen" />
+<link rel="shortcut icon" href="images/debathena-icon.png" type="image/png" />
+</head>
+<body>
+
+<div id="logo"><img src="images/debathena-owl-100.png" alt="Debathena Owl" /></div>
+
+<h1>Welcome to Athena</h1>
+
+<p>
+This is a restricted pre-login web browser session in which you can:
+<ul>
+<li><a href="http://web.mit.edu/register"><strong>Register for an Athena account</strong></a>.</li>
+</ul>
+</p>
+
+<p>
+You can also visit:
+<ul>
+<li>The <a href="http://web.mit.edu">MIT</a> home page.</li>
+<li>The <a href="http://debathena.mit.edu">Debathena</a> home page.</li>
+</ul>
+</p>
+
+<p>
+When you have completed this browser session, please exit by entering
+the Control-Q key combination, or by clicking the 'X' button at the
+top right of the screen.
+</p>
+
+</body>
+</html>
Added: trunk/debathena/debathena/kiosk/launch-kiosk
===================================================================
--- trunk/debathena/debathena/kiosk/launch-kiosk 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/launch-kiosk 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# Start an X server for the kiosk user on an available VT.
+
+if [ "$(id -u)" -ne 0 ]; then
+ echo "You must be root to launch kiosk mode." 1>&2
+ exit 1
+fi
+
+libdir=/usr/lib/debathena-kiosk
+kiosk_user=kiosk@mit
+kiosk_group=nogroup
+kiosk_home="/home/$kiosk_user"
+kiosk_vt_file=/var/run/athena-kiosk-vt
+display=99
+unset XAUTHORITY
+
+# See if we already have a running kiosk session.
+kiosk_vt=$(cat "$kiosk_vt_file" 2>/dev/null)
+if [ -n "$kiosk_vt" ]; then
+ chvt "$kiosk_vt" && exit 0
+fi
+
+# Get the VT to use.
+kiosk_vt=$(fgconsole --next-available)
+if [ -z "$kiosk_vt" ]; then
+ echo "$0: No available VTs" 1>&2
+ exit 1
+fi
+
+# Remember that we have allocated a VT for a kiosk session.
+echo "$kiosk_vt" > "$kiosk_vt_file"
+
+# Set up the kiosk user home directory.
+rm -rf "$kiosk_home"
+mkdir "$kiosk_home"
+cp "$libdir/xinitrc" "$kiosk_home/.xinitrc"
+chown -R "$kiosk_user":"$kiosk_group" "$kiosk_home"
+
+# Launch the session on our VT, and wait for it to complete. This will
+# switch back to the current VT upon completion.
+openvt -c "$kiosk_vt" -s -w -- su -s /bin/sh -c "startx -- :$display -br \
+ -audit 0 -nolisten tcp vt$kiosk_vt" "$kiosk_user"
+
+# Ensure that the VT is deallocated.
+deallocvt "$kiosk_vt" > /dev/null 2>&1
+rm -f "$kiosk_vt_file"
+
+rm -f "$kiosk_home/.Xauthority"
Property changes on: trunk/debathena/debathena/kiosk/launch-kiosk
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/debathena/debathena/kiosk/prefs.js
===================================================================
--- trunk/debathena/debathena/kiosk/prefs.js 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/prefs.js 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,17 @@
+// Enable the navigation bar, and do not auto-hide it.
+user_pref("rkiosk.navbar", true);
+user_pref("browser.fullscreen.autohide", false);
+
+// Do not invoke external applications.
+user_pref("network.protocol-handler.external.mailto", false);
+user_pref("network.protocol-handler.external.news", false);
+user_pref("network.protocol-handler.external.nntp", false);
+user_pref("network.protocol-handler.external-default", false);
+
+// Needed because r-kiosk's maxVersion is set to 3.0, not 3.0.*.
+user_pref("extensions.checkCompatibility", false);
+
+// Set the home page.
+user_pref("browser.startup.homepage", "file:///usr/lib/debathena-kiosk/index.html");
+user_pref("startup.homepage_override_url", "");
+user_pref("startup.homepage_welcome_url", "");
Added: trunk/debathena/debathena/kiosk/r-kiosk.xpi
===================================================================
(Binary files differ)
Property changes on: trunk/debathena/debathena/kiosk/r-kiosk.xpi
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/debathena/debathena/kiosk/styles/layout.css
===================================================================
--- trunk/debathena/debathena/kiosk/styles/layout.css 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/styles/layout.css 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,46 @@
+/*
+ Why do I have the sinking feeling that a year from now, the entire
+ world is going to look like the Debathena webpage?
+
+ Creating your own stylesheet really isn't that hard. You are
+ welcome to use this one as a reference, but please avoid copying the
+ entire layout. At least have the decency to change the fonts,
+ colors, and margins so that your site doesn't become visually
+ identified with Debathena.
+*/
+
+/* This file contains screen-only layout declarations that won't be
+ used for printing. */
+
+/* Make <body /> show up as a centered white box with rounded border,
+ over the darker enclosing <html />. */
+html {
+ padding: .75em;
+ background: #602;
+}
+body {
+ position: relative;
+ margin: 0 auto;
+ padding: 1em;
+ border: 1px solid black;
+ -moz-border-radius: .4em;
+ -webkit-border-radius: .4em;
+ border-radius: .4em;
+ background: #fff;
+}
+
+/* Limit the <body /> width for readability. */
+body {
+ max-width: 66em;
+}
+
+/* Increase line heights for better screen readability. */
+p, li, dt, dd, address {
+ line-height: 1.5em;
+}
+.short dt, .short dd, .shorter dt, .shorter dd {
+ line-height: 1.1em;
+}
+pre {
+ line-height: 1.25em;
+}
Added: trunk/debathena/debathena/kiosk/styles/style.css
===================================================================
--- trunk/debathena/debathena/kiosk/styles/style.css 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/styles/style.css 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,171 @@
+/*
+ Why do I have the sinking feeling that a year from now, the entire
+ world is going to look like the Debathena webpage?
+
+ Creating your own stylesheet really isn't that hard. You are
+ welcome to use this one as a reference, but please avoid copying the
+ entire layout. At least have the decency to change the fonts,
+ colors, and margins so that your site doesn't become visually
+ identified with Debathena.
+*/
+
+/* Basic fonts and sizes. */
+html {
+ font-size: 87.5%;
+}
+body {
+ font-family: Tahoma, Sans, sans-serif;
+}
+h1, h2, h3, h4, h5, h6 {
+ font-family: "Trebuchet MS", Trebuchet, Sans, sans-serif;
+}
+pre, code, samp, kbd, tt {
+ font-family: "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Luxi Mono", Consolas, "Andale Mono", Monaco, "Courier New", monospace;
+ font-size: 100%;
+}
+
+/* Colors. */
+h1, h2, h3, h4, h5, h6 {
+ color: #d70751;
+}
+:link {
+ color: #06c;
+}
+:visited {
+ color: #039;
+}
+var {
+ color: #090;
+}
+ins {
+ text-decoration: none;
+ color: #090;
+}
+pre {
+ background: #f6f6f6;
+ border-color: #ddd;
+}
+.note {
+ background: #ffd;
+ border-color: #eea;
+}
+
+/* Remove link underline until hover. */
+:link, :visited {
+ text-decoration: none;
+}
+:link:hover, :visited:hover {
+ text-decoration: underline;
+}
+
+/* And remove the weird border around linked images. */
+:link img, :visited img {
+ border: none;
+}
+
+/* Dashed lines for the header and footer. */
+h1 {
+ border-bottom: 1px dashed black;
+ margin-top: 0;
+ overflow: auto;
+}
+address {
+ margin-top: 2em;
+ border-top: 1px dashed black;
+ padding-top: .5em;
+}
+
+/* Display <kbd /> in boldface to distinguish typed input from displayed output. */
+kbd {
+ font-weight: bold;
+}
+
+/* <dt /> in boldface so it is more usable as a header. */
+dt {
+ font-weight: bold;
+}
+
+/* Add extra margin between entries in lists with class="long". */
+.long li, dl.long dd {
+ margin-bottom: .5em;
+}
+
+/* <dl class="short" /> and <dl class="shorter" /> get displayed like
+ a two-column table. */
+dl.short dt {
+ clear: both;
+ float: left;
+ min-width: 28em;
+}
+dl.short dd {
+ margin-left: 28em;
+ margin-bottom: .5em;
+}
+dl.shorter dt {
+ clear: both;
+ float: left;
+ min-width: 16em;
+}
+dl.shorter dd {
+ margin-left: 16em;
+ margin-bottom: .5em;
+}
+
+/* Make a rounded box around <pre /> and <p class="note" />. */
+pre, .note, .index table {
+ border-style: solid;
+ border-width: 1px;
+ -moz-border-radius: .4em;
+ -webkit-border-radius: .4em;
+ border-radius: .4em;
+ padding: .125em;
+}
+
+/* Right-floated Debathena logo. */
+#logo {
+ float: right;
+ margin: -1em -1em 0 0;
+}
+
+/* Alignment for tiny link icons. */
+.linkicon {
+ vertical-align: middle;
+ margin-right: .25em;
+}
+
+/* The navlinks list on the Debathena front page. */
+.navlinks {
+ margin: 1em 0;
+ padding: 0 2em;
+}
+.navlinks li {
+ list-style-type: none;
+}
+.navlinks .linkicon {
+ margin-right: 1em;
+}
+
+/* Apache-generated directory indexes. */
+.index h1 tt {
+ font-size: 83%;
+}
+.index table {
+ background: #fec;
+ border-color: #eca;
+ border-collapse: separate;
+ border-spacing: 1em 0.125em;
+ margin: 0.5em;
+}
+.index table th {
+ border-bottom: 1px solid black;
+}
+.index table th, .index table td {
+ padding: 0;
+ border: none;
+ margin: 0;
+}
+.index table.parent {
+ border: none;
+ padding: 0;
+ background: none;
+}
Added: trunk/debathena/debathena/kiosk/userChrome.css
===================================================================
--- trunk/debathena/debathena/kiosk/userChrome.css 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/userChrome.css 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,32 @@
+/*
+ * Additional UI customizations for kiosk mode.
+ */
+
+/*
+ * Do not remove the @namespace line -- it's required for correct functioning
+ */
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
+
+/* Disable window controls other than "close" for fullscreen mode. */
+#nav-bar #window-controls #minimize-button, #restore-button
+{
+ display:none !important;
+}
+
+/* Disable the URL input. */
+#urlbar
+{
+ display:none !important;
+}
+
+/* Disable the search box. */
+#searchbar
+{
+ display:none !important;
+}
+
+/* Disallow exit from fullscreen mode. */
+menuitem[label="Exit Full Screen Mode"]
+{
+ display:none !important;
+}
Added: trunk/debathena/debathena/kiosk/xinitrc
===================================================================
--- trunk/debathena/debathena/kiosk/xinitrc 2009-06-17 19:59:28 UTC (rev 23864)
+++ trunk/debathena/debathena/kiosk/xinitrc 2009-06-17 20:08:30 UTC (rev 23865)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# This is the xinit script for the kiosk user.
+
+libdir=/usr/lib/debathena-kiosk
+
+# The rkiosk extension's unique ID, and the location of its xpi file.
+rkiosk_id="{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}"
+rkiosk_xpi=$libdir/r-kiosk.xpi
+
+# File with preferences to set in the firefox profile.
+prefs="$libdir/prefs.js"
+
+# User chrome (UI customizations) file.
+chrome="$libdir/userChrome.css"
+
+cd || exit 1
+
+exec > xinit.log 2>&1
+
+XAUTHORITY=$HOME/.Xauthority
+export XAUTHORITY
+
+# Run a window manager so that firefox fullscreen mode works.
+metacity --sm-disable &
+
+# Create a new firefox profile.
+rm -rf .mozilla
+firefox -CreateProfile default > /dev/null || exit 1
+profdir=$(find .mozilla/firefox -type d -name \*.default)
+
+# Add the rkiosk extension.
+mkdir -p "$profdir/extensions/$rkiosk_id"
+(cd "$profdir/extensions/$rkiosk_id" && unzip "$rkiosk_xpi") || exit 1
+cat <<EOF >> "$profdir/extensions.ini"
+[ExtensionDirs]
+Extension0=$profdir/extensions/$rkiosk_id
+EOF
+
+# Apply our preference settings and UI customizations.
+cat "$prefs" >> "$profdir/prefs.js" || exit 1
+cp "$chrome" "$profdir/chrome/userChrome.css" || exit 1
+
+# Launch firefox.
+firefox
+
+# Clean up.
+rm -rf .mozilla