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

Revision 25698, 2.6 KB checked in by jdreed, 12 years ago (diff)
In kiosk: * Put bugme in the bottom right of the screen (Trac: #1199) * Bump standards-version
RevLine 
[23865]1#!/bin/sh
2
3# This is the xinit script for the kiosk user.
4
[24213]5datadir=/usr/share/debathena-kiosk
[23865]6
7# The rkiosk extension's unique ID, and the location of its xpi file.
8rkiosk_id="{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}"
[24213]9rkiosk_xpi=$datadir/r-kiosk.xpi
[23865]10
11# File with preferences to set in the firefox profile.
[24213]12prefs="$datadir/prefs.js"
[23865]13
14# User chrome (UI customizations) file.
[24213]15chrome="$datadir/userChrome.css"
[23865]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
[24839]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
[24842]32    errtext="An error occurred while trying to launch the registration applet.  Please try another workstation."
[24839]33    classzip="/afs/athena.mit.edu/system/register/java/regclasses.zip"
34    if [ ! -r "$classzip" ]; then
[24842]35        zenity --error --text="${errtext}\n\n(could not unzip class file)"
[24839]36        exit 0
37    fi
38    unzip $classzip
[24842]39    java -Dhost="moira.mit.edu" regapplet.Regapplet || zenity --error --text="${errtext}\n\n(could not launch java)"
[24839]40    exit 0
41fi
42
[25374]43# Warn the user that printing is wrong.
44zenity --warning --title="No Printing" --text="You will not be able to print from this browser session.  Submitted print jobs will be discarded and cannot be released from Pharos printers.\n\nIf you need to print, please log in to a normal Athena session.  If you are a visitor looking to print a Campus Map, please visit the Information Center in Room 7-121."
45
[23865]46# Create a new firefox profile.
47rm -rf .mozilla
48firefox -CreateProfile default > /dev/null || exit 1
49profdir=$(find .mozilla/firefox -type d -name \*.default)
50
51# Add the rkiosk extension.
[24578]52rkiosk_dir="$profdir/extensions/$rkiosk_id"
53mkdir -p "$rkiosk_dir"
54(cd "$rkiosk_dir" && unzip "$rkiosk_xpi") || exit 1
[23865]55cat <<EOF >> "$profdir/extensions.ini"
56[ExtensionDirs]
[24578]57Extension0=$rkiosk_dir
[23865]58EOF
59
[24578]60# Firefox 3.6+ requires a chrome.manifest for the extension.
61if [ ! -e "$rkiosk_dir/chrome.manifest" ]; then
62  cp "$datadir/chrome.manifest.r-kiosk" "$rkiosk_dir/chrome.manifest" || exit 1
63fi
64
[23865]65# Apply our preference settings and UI customizations.
66cat "$prefs" >> "$profdir/prefs.js" || exit 1
[25375]67mkdir -p "$profdir/chrome"
[23865]68cp "$chrome" "$profdir/chrome/userChrome.css" || exit 1
69
70# Launch firefox.
[25526]71if [ "$(machtype -q)" = "quickstation" ] && [ -x /usr/bin/bugme ]; then
[25698]72    bugme --fatal --corner SE firefox
[25526]73else
74    firefox
75fi
[23865]76
[25526]77
[23865]78# Clean up.
79rm -rf .mozilla
Note: See TracBrowser for help on using the repository browser.