#! /usr/bin/perl -w ### # # Another 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; # Fill the screen with the iHook window. Requires iHook 0.8.7. print( "%WINDOWSIZE MAX\n" ); # 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. while ( 1 ) { # change the background picture periodically to give the effect of # a screensaver. note that the cancel button doesn't change position. # you may want to disable it and re-enabled it periodically. print( "%BACKGROUND /Another/Custom/Image/Describing/How/To/Login\n" ); sleep( 5 ); print( "%BACKGROUND /Yet/Another/Image\n" ); sleep( 5 ); print( "%BACKGROUND /Still/Another/Image\n" ); sleep( 5 ); print( "%BACKGROUND /Some/Custom/Image/Telling/User/How/To/Kill/iHook\n" ); sleep( 5 ); } exit( 0 );