From 150599760bba4918ddfcec5da1db27dea3d63cb9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 1 May 2021 11:18:46 +0100 Subject: Dzil-build release 1.0.0 (from 6bba3a8 on master) --- lib/App/XScreenSaver/DBus/InhibitSleep.pm | 110 ++++++++++++++++++------------ 1 file changed, 68 insertions(+), 42 deletions(-) (limited to 'lib/App/XScreenSaver/DBus/InhibitSleep.pm') diff --git a/lib/App/XScreenSaver/DBus/InhibitSleep.pm b/lib/App/XScreenSaver/DBus/InhibitSleep.pm index 226facf..ce980d7 100644 --- a/lib/App/XScreenSaver/DBus/InhibitSleep.pm +++ b/lib/App/XScreenSaver/DBus/InhibitSleep.pm @@ -6,71 +6,30 @@ use curry; use Net::DBus; use IPC::Run; use Log::Any; -# VERSION +our $VERSION = '1.0.0'; # VERSION # ABSTRACT: implements the logind "inhibitor locks" protocol -=head1 SYNOPSIS - - use Net::DBus::Reactor; - use App::XScreenSaver::DBus::InhibitSleep; - my $is = App::XScreenSaver::DBus::InhibitSleep->new; - $is->start; - - Net::DBus::Reactor->new->run; - -=attr C - -the DBus system bus - -=cut has bus => ( is => 'lazy', builder => sub { Net::DBus->system() } ); -=attr C - -the (e)logind DBus service - -=cut has logind_srv => ( is => 'lazy', builder => sub { shift->bus->get_service('org.freedesktop.login1') }, ); -=attr C - -the (e)logind DBus object - -=cut has logind_obj => ( is => 'lazy', builder => sub { shift->logind_srv->get_object('/org/freedesktop/login1') }, ); -=attr C - -the file descriptor that logind gives us when we ask for a lock; we -close it to release the lock - -=cut has inhibit_fd => ( is => 'rwp' ); -=attr C - -a logger - -=cut has log => ( is => 'lazy', builder => sub { Log::Any->get_logger } ); -=method C - -starts listening to the C signal from (e)logind, and -takes the lock - -=cut sub start($self) { $self->logind_obj->connect_to_signal( @@ -121,3 +80,70 @@ sub _xscreensaver_command($self,$command) { } 1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::XScreenSaver::DBus::InhibitSleep - implements the logind "inhibitor locks" protocol + +=head1 VERSION + +version 1.0.0 + +=head1 SYNOPSIS + + use Net::DBus::Reactor; + use App::XScreenSaver::DBus::InhibitSleep; + my $is = App::XScreenSaver::DBus::InhibitSleep->new; + $is->start; + + Net::DBus::Reactor->new->run; + +=head1 ATTRIBUTES + +=head2 C + +the DBus system bus + +=head2 C + +the (e)logind DBus service + +=head2 C + +the (e)logind DBus object + +=head2 C + +the file descriptor that logind gives us when we ask for a lock; we +close it to release the lock + +=head2 C + +a logger + +=head1 METHODS + +=head2 C + +starts listening to the C signal from (e)logind, and +takes the lock + +=head1 AUTHOR + +Gianni Ceccarelli + +=head1 COPYRIGHT AND LICENSE + +This software is Copyright (c) 2021 by Gianni Ceccarelli . + +This is free software, licensed under: + + The GNU Affero General Public License, Version 3, November 2007 + +=cut -- cgit v1.2.3