Add a new button to the Cave kiosk
The Cave kiosk interface automatically displays buttons for scripts in a certain location whose names are formatted in a particular way. There are currently two interfaces, for which buttons must be configured separately.
- The new interface, which will eventually become the only interface, is located on the wallconsole machine at
/var/www/html/kiosk-jnh/kiosk.cgiand may be viewed on the web from any machine in the Cave room. - The old interface, which will eventually be deprecated, is located on the wallconsole machine at
/var/www/html/kiosk/kiosk.cgiviewed on the web from any machine in the Cave room.
To add a new button to the kiosk interface, especially if it corresponds to a new user, you're probably going to have to both create a button and configure the data directories.
Create a Button
On the New Interface
The new interface parses a directory structure on the CCV filesystem to generate tabs and buttons, so adding them is a snap, with no SSHing required.
cd ~cavedemo/kiosk- Within this directory are directories corresponding to the tabs on the kiosk interface. We try to keep the number of tabs limited, so you probably don't need to create a new directory.
cdinto the directory for the tab you want your button to appear in. cp -r <old> <new>to copy an old directory/button to a new one.cd <new>nano runto edit the script that the button executes, and change the username or other information as necessary.
Here's an example of a current script, ~cavedemo/kiosk/CS137_2008/jadrian/run:
#!/bin/sh export GROOT=/share/gfx2/dollar-g source $GROOT/tools/gfxtools-startup-bash user="jadrian" basepath="/share/cs137/dollar-g-cs137/tools/linux/data/cavepaintings/$user" $G/bin/cavepainting-cave -c SaveBasePath=$basepath -c LoadBasePath=$basepath -c UserDataDir=$basepath
On the Old Interface
Adding a new tab to the old interface currently involves editing the source of the web script and is therefore beyond the scope of this article, but adding a button to an existing tab is easy if a little ugly.
- Log into wallconsole:
ssh cavedemo@wallconsole cd $G/bin- Find within this directory a script for an existing button; we'll call this script
script_1in the code for the following steps. For example,cave.cscluster.cs137fall08.jadriancorresponds to the "(cscluster) jadrian" button on the "CS137 Fall 2008" tab. - Pick the name of your new script. The name is in four parts:
<environment><machine><group><name>. The environment is eithercaveorpowerwall. The machine choices for thecaveenvironment arecsclusterorcluster4. The group corresponds to the tab the button will appear on; you'll probably wantgeneral(for the "Run Programs" tab) or whatever the active variant ofcs137is. Finally, the name can be whatever you want, and will be the label on the button. Now that you've picked the name, we will refer to that asscript_2. cp script_1 script_2nano script_2to edit the script and change the commands it runs. For creating new Cavepainting scripts, you'll probably just want to change the names of the save, load, and data paths.- Be sure to double-check that the paths referred to in the script exist by logging into cs-nodes.
- Reload the kiosk webpage and your new button should be there!
Configure the Data Directories
For CS137, by default the data directory for a new user is /share/cs137/dollar-g-cs137/tools/linux/data/cavepaintings/<user>. You'll need to create this directory and make sure that its group is cs-cave. It's okay for the directory to be empty, as Cavepainting reads default content from elsewhere, but you may want to copy some things from other users.
Note that these directions don't check your data (or kiosk script, for that matter) into $G, like they should! Somebody ought to update them. =)