#! /usr/bin/perl -w ### # # A sort of screen saver using iHook. A temporary solution for # the lack of screen saver at the Mac OS X login screen. # ### use strict; my ( $oldhandle ); sub sigterm_handler { exit( 0 ); } # Turn on autoflush feature. $|++; $oldhandle = select( STDERR ); $|++; select( $oldhandle ); # Catch SIGTERM, which iHook sends when user clicks cancel button, # so iHook exits cleanly, revealing the login window. $SIG{ 'TERM' } = \&sigterm_handler; # set the first background image. print( "%BACKGROUND /Some/Custom/Image/Telling/User/How/To/Kill/iHook\n" ); # enable the cancel button, so the user can kill iHook and login. print( "%CANCEL ENABLE\n" ); print( "Click the Cancel button to get to the login screen.\n" ); sleep( 5 ); # Enter an infinite loop. The user will be killing the process when they # click the cancel button to get back to the login screen. The sleeps give # the user time to click the cancel button. while ( 1 ) { # move the iHook window around the screen. You may also want to change # the iHook window size with the %WINDOWSIZE directive. print( "%WINDOWPOSITION TOP LEFT\n" ); sleep( 5 ); print( "%WINDOWPOSITION TOP RIGHT\n" ); print( "%BACKGROUND /Another/Custom/Image/Describing/How/To/Login\n" ); sleep( 5 ); print( "%WINDOWPOSITION BOTTOM RIGHT\n" ); print( "%BACKGROUND /Yet/Another/Image\n" ); sleep( 5 ); print( "%WINDOWPOSITION BOTTOM LEFT\n" ); print( "%BACKGROUND /Still/Another/Image\n" ); sleep( 5 ); print( "%WINDOWPOSITION CENTER\n" ); print( "%BACKGROUND /Some/Custom/Image/Telling/User/How/To/Kill/iHook\n" ); sleep( 5 ); } exit( 0 );