source: trunk/debathena/debathena/kiosk/xinitrc @ 24839

Revision 24839, 1.9 KB checked in by jdreed, 14 years ago (diff)
In kiosk: * Offer the user a chance to run the standalone reg applet, since IcedTea sucks (Trac: #675, #650)
Line 
1#!/bin/sh
2
3# This is the xinit script for the kiosk user.
4
5datadir=/usr/share/debathena-kiosk
6
7# The rkiosk extension's unique ID, and the location of its xpi file.
8rkiosk_id="{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}"
9rkiosk_xpi=$datadir/r-kiosk.xpi
10
11# File with preferences to set in the firefox profile.
12prefs="$datadir/prefs.js"
13
14# User chrome (UI customizations) file.
15chrome="$datadir/userChrome.css"
16
17cd || exit 1
18
19exec > xinit.log 2>&1
20
21XAUTHORITY=$HOME/.Xauthority
22export XAUTHORITY
23
24# Run a window manager so that firefox fullscreen mode works.
25metacity --sm-disable &
26
27choice=$(zenity --title="What would you like to do?" --text="Select the task y\
28ou wish to perform, then click \"OK\"" --list  --column="task" --column="Activ\
29ity" --hide-column=1 "reg" "Register for Account" "web" "Browse the Web")
30[ $? -eq 0 ] || exit 0
31if [ "$choice" = "reg" ]; then
32    classzip="/afs/athena.mit.edu/system/register/java/regclasses.zip"
33    if [ ! -r "$classzip" ]; then
34        zenity --error --text="An error occurred while trying to launch the registration applet.  Please try another workstation."
35        exit 0
36    fi
37    unzip $classzip
38    java -Dhost="moira.mit.edu" regapplet.Regapplet
39    exit 0
40fi
41
42# Create a new firefox profile.
43rm -rf .mozilla
44firefox -CreateProfile default > /dev/null || exit 1
45profdir=$(find .mozilla/firefox -type d -name \*.default)
46
47# Add the rkiosk extension.
48rkiosk_dir="$profdir/extensions/$rkiosk_id"
49mkdir -p "$rkiosk_dir"
50(cd "$rkiosk_dir" && unzip "$rkiosk_xpi") || exit 1
51cat <<EOF >> "$profdir/extensions.ini"
52[ExtensionDirs]
53Extension0=$rkiosk_dir
54EOF
55
56# Firefox 3.6+ requires a chrome.manifest for the extension.
57if [ ! -e "$rkiosk_dir/chrome.manifest" ]; then
58  cp "$datadir/chrome.manifest.r-kiosk" "$rkiosk_dir/chrome.manifest" || exit 1
59fi
60
61# Apply our preference settings and UI customizations.
62cat "$prefs" >> "$profdir/prefs.js" || exit 1
63cp "$chrome" "$profdir/chrome/userChrome.css" || exit 1
64
65# Launch firefox.
66firefox
67
68# Clean up.
69rm -rf .mozilla
Note: See TracBrowser for help on using the repository browser.