Event::ScreenSaver::Unix - Provides the Unix & Unix like screen saver monitoring code.
This documentation refers to Event::ScreenSaver::Unix version 0.0.4.
use Event::ScreenSaver::Unix; # create the screen saver object my $ss = Event::ScreenSaver::Unix->new(); # add functions to events $ss->start( sub {print "The screen saver started\n" } ); $ss->stop( sub { print "The screen saver stopped\n" } ); # run the event handler $ss->run();
This library provides an easy way to hook to the starting and stopping of the screen saver (currently only in Unix like environments).
The call back functions are passed the current event object.
start ( [$sub] )
Param: $sub - sub - The starting call back function
$sub
Return: sub - The currently set starting function
Description: Sets/Gets the function that will be called when the screen saver is started.
stop ( [$sub] )
Param: $sub - sub - The stopping call back function
Return: sub - The currently set stopping function
Description: Sets/Gets the function that will be called when the screen saver is stopped.
run ()
This function starts the process for listening for screen saver events. It does not return.
There appears to be an issue with Net::DBus where if the code calling this module also uses Net::DBus the Net::DBus::Reactor will not run.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
Ivan Wills - (ivan.wills@gmail.com)
Copyright (c) 2009 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Event::ScreenSaver, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Event::ScreenSaver
CPAN shell
perl -MCPAN -e shell install Event::ScreenSaver
For more information on module installation, please visit the detailed CPAN module installation guide.