Cocoa-BatteryInfo
view release on metacpan or search on metacpan
Register low battery event handler called when the battery time
remaining drops into a warnable level.
time_remaining_handler($callback :CodeRef)
Register time remaining event handler called when the power source(s)
time remaining changes.
NOTICE
Callbacks listed above do nothing without under the Cocoa's event loop.
To work those callbacks correctly, you have to use this module with
Cocoa::EventLoop:
use Cocoa::EventLoop;
use Cocoa::BatteryInfo;
Cocoa::BatteryInfo::low_battery_handler {
# do something;
};
Cocoa::EventLoop->run;
lib/Cocoa/BatteryInfo.pm view on Meta::CPAN
Register low battery event handler called when the battery time remaining drops into a warnable level.
=head2 time_remaining_handler($callback :CodeRef)
Register time remaining event handler called when the power source(s) time remaining changes.
=head1 NOTICE
Callbacks listed above do nothing without under the Cocoa's event loop.
To work those callbacks correctly, you have to use this module with L<Cocoa::EventLoop>:
use Cocoa::EventLoop;
use Cocoa::BatteryInfo;
Cocoa::BatteryInfo::low_battery_handler {
# do something;
};
Cocoa::EventLoop->run;
( run in 1.176 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )