Difference between revisions of "Kiosk display on a Mac Powerbook"

From dftwiki3
Jump to: navigation, search
(Account)
(Setup)
Line 17: Line 17:
  
 
=Setup=
 
=Setup=
* "New Account" is set to '''automatic login'''
+
* Install wget on the Powerbook.
* The movie to play at startup in a loop is put on Desktop, in '''DisplayCase.mov'''.
+
* Using Systems Preferences, go to '''Users''' and set '''newaccount''  to '''automatic login'''
* In the '''Users''' pane of the Systems Preference app, with '''New Account''' selected, click on '''Login Items''' and put the movie '''DisplayCase.mov''' in the window.  ''Do not click'' on the '''Hide''' box.
+
* Load the first copy of the movie to play at startup in a loop in the '''Desktop''' folder, and call it '''DisplayCase.mov'''.  This is also the name of the original movie file on the server.
 +
* In the '''Users''' pane of the Systems Preference app, with '''newaccount''' selected, click on '''Login Items''' and put the movie '''DisplayCase.mov''' in the window.  ''Do not click'' on the '''Hide''' box.
 +
* Create a '''bin''' directory in the '''newaccount''' directory. 
 +
* Create the script '''updateMovie.sh''' with the following content:
 +
<code><pre>
 +
#! /bin/bash
 +
# D. Thiebaut
 +
# script that will download movie from given url if it is more recent
 +
# than local copy.  If download is performed, the laptop is restarted
 +
# so as to force Quicktime to stop and restart.  The movie will automatically
 +
# be played at login because it is in the "logins" list for the current account.
 +
# see
 +
movie="DisplayCase.mov"
 +
url="http://xgridmac.dyndns.org/~thiebaut/${movie}"
 +
wget="/usr/local/bin/wget"
  
 +
cd ~/Desktop
 +
 +
currentTimeStamp=`stat -f "%m%t%Sm" $movie`
 +
$wget -q -N $url
 +
newTimeStamp=`stat -f "%m%t%Sm" $movie`
 +
if [ "$currentTimeStamp" != "$newTimeStamp" ]; then
 +
    #echo "movie updated!"
 +
    osascript -e 'tell application "Finder" to restart'
 +
fi
 +
 +
 +
</pre></code>
 
<br />
 
<br />
 
<br />
 
<br />

Revision as of 12:42, 10 April 2013

--D. Thiebaut 10:37, 10 April 2013 (EDT)


A series of step to create a kiosk on a PowerBook mac.

Setup and Platforms

The idea is to have the Powerbook download a Quicktime movie from a server when a new version of it has been created, and automatically run it in a loop, full screen.

The mac used for displaying the endless loop is an old Powerbook PowerPC G4 running Mac OS X 10.5.8 that was collecting dust. It is connected to an external display.

The original .mov movie that is to be displayed is located a server, at a given URL, and the Powerbook will check regularly (in our case every 10 minutes) to see if that file has been recently updated. If it has been, the Powerbook uses wget (downloaded from here) to download the movie, and the Powerbook is restarted (automatically) so that Quicktime can restart with the new movie.

Account

The account under which everything runs on the Powerbook is "newccount", which has no password, and admin privileges.

Setup

  • Install wget on the Powerbook.
  • Using Systems Preferences, go to Users' and set newaccount to automatic login
  • Load the first copy of the movie to play at startup in a loop in the Desktop folder, and call it DisplayCase.mov. This is also the name of the original movie file on the server.
  • In the Users pane of the Systems Preference app, with newaccount selected, click on Login Items and put the movie DisplayCase.mov in the window. Do not click on the Hide box.
  • Create a bin directory in the newaccount directory.
  • Create the script updateMovie.sh with the following content:
#! /bin/bash
# D. Thiebaut
# script that will download movie from given url if it is more recent
# than local copy.  If download is performed, the laptop is restarted
# so as to force Quicktime to stop and restart.  The movie will automatically
# be played at login because it is in the "logins" list for the current account.
# see 
movie="DisplayCase.mov"
url="http://xgridmac.dyndns.org/~thiebaut/${movie}"
wget="/usr/local/bin/wget"

cd ~/Desktop

currentTimeStamp=`stat -f "%m%t%Sm" $movie`
$wget -q -N $url
newTimeStamp=`stat -f "%m%t%Sm" $movie`
if [ "$currentTimeStamp" != "$newTimeStamp" ]; then
    #echo "movie updated!"
    osascript -e 'tell application "Finder" to restart'
fi