summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2021-05-06 15:16:20 +0100
committerdakkar <dakkar@thenautilus.net>2021-05-06 15:16:20 +0100
commita5c49ef9ec2ebf3a00e109d4d3c6418a22d235bd (patch)
tree6ff9f3618b2896c6fc42be1f5e90e2ff817465ac
parentv1.0.3 (diff)
parentDzil-build release 1.0.2 (from 9b55673 on master) (diff)
downloadxscreensaver-dbus-release/master.tar.gz
xscreensaver-dbus-release/master.tar.bz2
xscreensaver-dbus-release/master.zip
Dzil-build release 1.0.3 (from 26c0653 on master)v1.0.3release/master
-rw-r--r--.gitignore15
-rw-r--r--Changes2
-rw-r--r--MANIFEST17
-rw-r--r--META.json74
-rw-r--r--META.yml43
-rw-r--r--Makefile.PL82
-rw-r--r--dist.ini88
-rw-r--r--lib/App/XScreenSaver/DBus.pm91
-rw-r--r--lib/App/XScreenSaver/DBus/Logind.pm119
-rw-r--r--lib/App/XScreenSaver/DBus/Saver.pm144
-rw-r--r--lib/App/XScreenSaver/DBus/SaverProxy.pm45
-rwxr-xr-xscripts/xscreensaver-dbus59
-rw-r--r--t/00-compile.t100
-rw-r--r--t/author-pod-spell.t35
-rw-r--r--t/author-pod-syntax.t15
-rw-r--r--weaver.ini50
16 files changed, 669 insertions, 310 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 4fa6083..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-blib
-pm_to_blib
-*.sw?
-Makefile
-Makefile.old
-MANIFEST.bak
-*.tar.gz
-/inc/
-/META.*
-/MYMETA.*
-.prove
-*~
-/.build/
-/App-XScreenSaver-DBus-*/
-/App-XScreenSaver-DBus-*.tar.gz
diff --git a/Changes b/Changes
index d3a7242..615dc8c 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,3 @@
-{{$NEXT}}
-
1.0.3 2021-05-06 15:16:13+01:00 Europe/London
- lock the screen when (e)logind says so
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..ddfb4e9
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,17 @@
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017.
+Changes
+LICENSE
+MANIFEST
+META.json
+META.yml
+Makefile.PL
+cpanfile
+lib/App/XScreenSaver/DBus.pm
+lib/App/XScreenSaver/DBus/Logind.pm
+lib/App/XScreenSaver/DBus/Saver.pm
+lib/App/XScreenSaver/DBus/SaverProxy.pm
+perlcritic.rc
+scripts/xscreensaver-dbus
+t/00-compile.t
+t/author-pod-spell.t
+t/author-pod-syntax.t
diff --git a/META.json b/META.json
new file mode 100644
index 0000000..97d3bbb
--- /dev/null
+++ b/META.json
@@ -0,0 +1,74 @@
+{
+ "abstract" : "tie xscreensaver into dbus",
+ "author" : [
+ "Gianni Ceccarelli <dakkar@thenautilus.net>"
+ ],
+ "dynamic_config" : 0,
+ "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010",
+ "license" : [
+ "agpl_3"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : 2
+ },
+ "name" : "App-XScreenSaver-DBus",
+ "no_index" : {
+ "directory" : [
+ "t/lib"
+ ]
+ },
+ "prereqs" : {
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "develop" : {
+ "requires" : {
+ "Test::Pod" : "1.41",
+ "Test::Spelling" : "0.12"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "IPC::Run" : "0",
+ "Log::Any" : "0",
+ "Log::Any::Adapter" : "0",
+ "Moo" : "0",
+ "Net::DBus" : "0",
+ "Net::DBus::Exporter" : "0",
+ "Net::DBus::Object" : "0",
+ "Net::DBus::Reactor" : "0",
+ "Try::Tiny" : "0",
+ "curry" : "0",
+ "experimental" : "0",
+ "parent" : "0",
+ "perl" : "v5.20.0",
+ "strict" : "0",
+ "warnings" : "0"
+ }
+ },
+ "test" : {
+ "requires" : {
+ "File::Spec" : "0",
+ "IO::Handle" : "0",
+ "IPC::Open3" : "0",
+ "Test::More" : "0"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "repository" : {
+ "type" : "git",
+ "url" : "https://www.thenautilus.net/cgit/xscreensaver-dbus/",
+ "web" : "https://www.thenautilus.net/cgit/xscreensaver-dbus/"
+ }
+ },
+ "version" : "1.0.3",
+ "x_generated_by_perl" : "v5.32.0",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.23",
+ "x_spdx_expression" : "AGPL-3.0"
+}
+
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..ef49f6a
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,43 @@
+---
+abstract: 'tie xscreensaver into dbus'
+author:
+ - 'Gianni Ceccarelli <dakkar@thenautilus.net>'
+build_requires:
+ File::Spec: '0'
+ IO::Handle: '0'
+ IPC::Open3: '0'
+ Test::More: '0'
+configure_requires:
+ ExtUtils::MakeMaker: '0'
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010'
+license: open_source
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: '1.4'
+name: App-XScreenSaver-DBus
+no_index:
+ directory:
+ - t/lib
+requires:
+ IPC::Run: '0'
+ Log::Any: '0'
+ Log::Any::Adapter: '0'
+ Moo: '0'
+ Net::DBus: '0'
+ Net::DBus::Exporter: '0'
+ Net::DBus::Object: '0'
+ Net::DBus::Reactor: '0'
+ Try::Tiny: '0'
+ curry: '0'
+ experimental: '0'
+ parent: '0'
+ perl: v5.20.0
+ strict: '0'
+ warnings: '0'
+resources:
+ repository: https://www.thenautilus.net/cgit/xscreensaver-dbus/
+version: 1.0.3
+x_generated_by_perl: v5.32.0
+x_serialization_backend: 'YAML::Tiny version 1.73'
+x_spdx_expression: AGPL-3.0
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..3ea6d7d
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,82 @@
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.017.
+use strict;
+use warnings;
+
+use 5.020000;
+
+use ExtUtils::MakeMaker;
+
+my %WriteMakefileArgs = (
+ "ABSTRACT" => "tie xscreensaver into dbus",
+ "AUTHOR" => "Gianni Ceccarelli <dakkar\@thenautilus.net>",
+ "CONFIGURE_REQUIRES" => {
+ "ExtUtils::MakeMaker" => 0
+ },
+ "DISTNAME" => "App-XScreenSaver-DBus",
+ "EXE_FILES" => [
+ "scripts/xscreensaver-dbus"
+ ],
+ "LICENSE" => "open_source",
+ "MIN_PERL_VERSION" => "5.020000",
+ "NAME" => "App::XScreenSaver::DBus",
+ "PREREQ_PM" => {
+ "IPC::Run" => 0,
+ "Log::Any" => 0,
+ "Log::Any::Adapter" => 0,
+ "Moo" => 0,
+ "Net::DBus" => 0,
+ "Net::DBus::Exporter" => 0,
+ "Net::DBus::Object" => 0,
+ "Net::DBus::Reactor" => 0,
+ "Try::Tiny" => 0,
+ "curry" => 0,
+ "experimental" => 0,
+ "parent" => 0,
+ "strict" => 0,
+ "warnings" => 0
+ },
+ "TEST_REQUIRES" => {
+ "File::Spec" => 0,
+ "IO::Handle" => 0,
+ "IPC::Open3" => 0,
+ "Test::More" => 0
+ },
+ "VERSION" => "1.0.3",
+ "test" => {
+ "TESTS" => "t/*.t"
+ }
+);
+
+
+my %FallbackPrereqs = (
+ "File::Spec" => 0,
+ "IO::Handle" => 0,
+ "IPC::Open3" => 0,
+ "IPC::Run" => 0,
+ "Log::Any" => 0,
+ "Log::Any::Adapter" => 0,
+ "Moo" => 0,
+ "Net::DBus" => 0,
+ "Net::DBus::Exporter" => 0,
+ "Net::DBus::Object" => 0,
+ "Net::DBus::Reactor" => 0,
+ "Test::More" => 0,
+ "Try::Tiny" => 0,
+ "curry" => 0,
+ "experimental" => 0,
+ "parent" => 0,
+ "strict" => 0,
+ "warnings" => 0
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+ delete $WriteMakefileArgs{TEST_REQUIRES};
+ delete $WriteMakefileArgs{BUILD_REQUIRES};
+ $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
diff --git a/dist.ini b/dist.ini
deleted file mode 100644
index 694a5f8..0000000
--- a/dist.ini
+++ /dev/null
@@ -1,88 +0,0 @@
-name = App-XScreenSaver-DBus
-abstract = tie xscreensaver into dbus
-author = Gianni Ceccarelli <dakkar@thenautilus.net>
-license = AGPL_3
-copyright_holder = Gianni Ceccarelli <dakkar@thenautilus.net>
-copyright_year = 2021
-
-[GatherDir]
-
-[PodWeaver]
-; authordep Pod::Elemental::Transformer::List
-
-[PruneCruft]
-
-[PruneFiles]
-match = ~$
-filename = dist.ini
-filename = weaver.ini
-
-[Git::Check]
-allow_dirty = dist.ini
-
-[Git::NextVersion]
-first_version = 1.0.0
-
-[CheckChangeLog]
-
-[NextRelease]
-
-[AutoPrereqs]
-
-[OurPkgVersion]
-
-[ManifestSkip]
-
-[PodSyntaxTests]
-
-[Test::PodSpelling]
-stopword = logind
-stopword = dbus
-stopword = specialised
-
-[Test::Compile]
-fail_on_warning = author
-
-[ExtraTests]
-
-[Repository]
-repository = https://www.thenautilus.net/cgit/xscreensaver-dbus/
-type = git
-web = https://www.thenautilus.net/cgit/xscreensaver-dbus/
-
-[MetaNoIndex]
-directory = t/lib
-
-[MetaYAML]
-
-[MetaJSON]
-
-[ExecDir]
-dir = scripts
-
-[ShareDir]
-
-[MakeMaker]
-
-[Manifest]
-
-[TestRelease]
-
-[Git::Commit]
-
-[Git::CommitBuild]
-branch =
-release_branch = release/%b
-release_message = Dzil-build release %v (from %h on %b)
-multiple_inheritance = 1
-
-[Git::Tag / master]
-tag_format = v%v%t-dzilla
-
-[Git::Tag / release]
-branch = release/master
-tag_format = v%v%t
-
-[ConfirmRelease]
-
-[UploadToCPAN]
diff --git a/lib/App/XScreenSaver/DBus.pm b/lib/App/XScreenSaver/DBus.pm
index e36d0b6..2a94677 100644
--- a/lib/App/XScreenSaver/DBus.pm
+++ b/lib/App/XScreenSaver/DBus.pm
@@ -6,41 +6,21 @@ use Net::DBus::Reactor;
use Log::Any;
use App::XScreenSaver::DBus::Logind;
use App::XScreenSaver::DBus::Saver;
-# VERSION
+our $VERSION = '1.0.3'; # VERSION
# ABSTRACT: tie xscreensaver into dbus
-=head1 SYNOPSIS
-
- use App::XScreenSaver::DBus;
- App::XScreenSaver::DBus->new->run;
-
-=attr C<reactor>
-
-the event loop
-
-=cut
has reactor => (
is => 'lazy',
builder => sub { Net::DBus::Reactor->main() },
);
-=attr C<logind>
-
-instance of L<< C<App::XScreenSaver::DBus::Logind> >>.
-
-=cut
has logind => (
is => 'lazy',
builder => sub { App::XScreenSaver::DBus::Logind->new() },
);
-=attr C<saver>
-
-instance of L<< C<App::XScreenSaver::DBus::Saver> >>.
-
-=cut
has saver => (
is => 'lazy',
@@ -49,20 +29,9 @@ has saver => (
},
);
-=attr C<log>
-
-a logger
-
-=cut
has log => ( is => 'lazy', builder => sub { Log::Any->get_logger } );
-=method C<run>
-
-registers the DBus services and runs the event loop; this method does
-not return
-
-=cut
sub run($self) {
$self->logind->start();
@@ -71,3 +40,61 @@ sub run($self) {
}
1;
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+App::XScreenSaver::DBus - tie xscreensaver into dbus
+
+=head1 VERSION
+
+version 1.0.3
+
+=head1 SYNOPSIS
+
+ use App::XScreenSaver::DBus;
+ App::XScreenSaver::DBus->new->run;
+
+=head1 ATTRIBUTES
+
+=head2 C<reactor>
+
+the event loop
+
+=head2 C<logind>
+
+instance of L<< C<App::XScreenSaver::DBus::Logind> >>.
+
+=head2 C<saver>
+
+instance of L<< C<App::XScreenSaver::DBus::Saver> >>.
+
+=head2 C<log>
+
+a logger
+
+=head1 METHODS
+
+=head2 C<run>
+
+registers the DBus services and runs the event loop; this method does
+not return
+
+=head1 AUTHOR
+
+Gianni Ceccarelli <dakkar@thenautilus.net>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is Copyright (c) 2021 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+
+This is free software, licensed under:
+
+ The GNU Affero General Public License, Version 3, November 2007
+
+=cut
diff --git a/lib/App/XScreenSaver/DBus/Logind.pm b/lib/App/XScreenSaver/DBus/Logind.pm
index 21b3fb7..0c2abee 100644
--- a/lib/App/XScreenSaver/DBus/Logind.pm
+++ b/lib/App/XScreenSaver/DBus/Logind.pm
@@ -6,53 +6,24 @@ use curry;
use Net::DBus;
use IPC::Run;
use Log::Any;
-# VERSION
+our $VERSION = '1.0.3'; # VERSION
# ABSTRACT: implements the logind "inhibitor locks" and "session lock" protocols
-=head1 SYNOPSIS
-
- use Net::DBus::Reactor;
- use App::XScreenSaver::DBus::Logind;
- my $is = App::XScreenSaver::DBus::Logind->new;
- $is->start;
-
- Net::DBus::Reactor->new->run;
-
-=attr C<bus>
-
-the DBus system bus
-
-=cut
has bus => ( is => 'lazy', builder => sub { Net::DBus->system() } );
-=attr C<logind_srv>
-
-the (e)logind DBus service
-
-=cut
has logind_srv => (
is => 'lazy',
builder => sub { shift->bus->get_service('org.freedesktop.login1') },
);
-=attr C<logind_obj>
-
-the (e)logind DBus object
-
-=cut
has logind_obj => (
is => 'lazy',
builder => sub { shift->logind_srv->get_object('/org/freedesktop/login1') },
);
-=attr C<session_obj>
-
-the (e)logind session DBus object
-
-=cut
has session_obj => (
is => 'lazy',
@@ -62,29 +33,12 @@ has session_obj => (
},
);
-=attr C<inhibit_fd>
-
-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<log>
-
-a logger
-
-=cut
has log => ( is => 'lazy', builder => sub { Log::Any->get_logger } );
-=method C<start>
-
-starts listening to the C<PrepareForSleep> signal from (e)logind, and
-takes the lock
-
-=cut
sub start($self) {
$self->logind_obj->connect_to_signal(
@@ -153,3 +107,74 @@ sub _xscreensaver_command($self,$command) {
}
1;
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+App::XScreenSaver::DBus::Logind - implements the logind "inhibitor locks" and "session lock" protocols
+
+=head1 VERSION
+
+version 1.0.3
+
+=head1 SYNOPSIS
+
+ use Net::DBus::Reactor;
+ use App::XScreenSaver::DBus::Logind;
+ my $is = App::XScreenSaver::DBus::Logind->new;
+ $is->start;
+
+ Net::DBus::Reactor->new->run;
+
+=head1 ATTRIBUTES
+
+=head2 C<bus>
+
+the DBus system bus
+
+=head2 C<logind_srv>
+
+the (e)logind DBus service
+
+=head2 C<logind_obj>
+
+the (e)logind DBus object
+
+=head2 C<session_obj>
+
+the (e)logind session DBus object
+
+=head2 C<inhibit_fd>
+
+the file descriptor that logind gives us when we ask for a lock; we
+close it to release the lock
+
+=head2 C<log>
+
+a logger
+
+=head1 METHODS
+
+=head2 C<start>
+
+starts listening to the C<PrepareForSleep> signal from (e)logind, and
+takes the lock
+
+=head1 AUTHOR
+
+Gianni Ceccarelli <dakkar@thenautilus.net>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is Copyright (c) 2021 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+
+This is free software, licensed under:
+
+ The GNU Affero General Public License, Version 3, November 2007
+
+=cut
diff --git a/lib/App/XScreenSaver/DBus/Saver.pm b/lib/App/XScreenSaver/DBus/Saver.pm
index 6eae4ed..ab6339a 100644
--- a/lib/App/XScreenSaver/DBus/Saver.pm
+++ b/lib/App/XScreenSaver/DBus/Saver.pm
@@ -7,63 +7,27 @@ use Log::Any;
use Try::Tiny;
use IPC::Run;
use App::XScreenSaver::DBus::SaverProxy;
-# VERSION
+our $VERSION = '1.0.3'; # VERSION
# ABSTRACT: implements the "idle inhibition" protocol
-=head1 SYNOPSIS
-
- use Net::DBus::Reactor;
- use App::XScreenSaver::DBus::InhibitSleep;
-
- my $reactor = Net::DBus::Reactor->new;
- my $s = App::XScreenSaver::DBus::Saver->new(reactor => $reactor);
- $s->start;
-
- $reactor->run;
-
-=attr C<reactor>
-
-the event loop
-
-=cut
has reactor => ( is => 'ro', required => 1 );
-=attr C<bus>
-
-the DBus session bus
-
-=cut
has bus => ( is => 'lazy', builder => sub { Net::DBus->session() } );
-=attr C<dbus_srv>
-
-the DBus manager DBus service
-
-=cut
has dbus_srv => (
is => 'lazy',
builder => sub { shift->bus->get_service('org.freedesktop.DBus') },
);
-=attr C<dbus_obj>
-
-the DBus manager DBus object
-
-=cut
has dbus_obj => (
is => 'lazy',
builder => sub { shift->dbus_srv->get_object('/org/freedesktop/DBus') },
);
-=attr C<service>
-
-the DBus service we export
-
-=cut
has service => (
is => 'lazy',
@@ -73,25 +37,12 @@ has service => (
},
);
-=attr C<paths>
-
-the paths at which we export our DBus object
-
-there's two of them because different applications expect this object
-at different paths
-
-=cut
has paths => (
is => 'ro',
default => sub { [qw(/ScreenSaver /org/freedesktop/ScreenSaver)] },
);
-=attr C<log>
-
-a logger
-
-=cut
has log => ( is => 'lazy', builder => sub { Log::Any->get_logger } );
@@ -99,16 +50,6 @@ has _impls => ( is => 'rw' );
has _prod_id => ( is => 'rw' );
has _inhibits => ( is => 'rw', default => sub { +{} } );
-=method C<start>
-
-Exports our object to the session bus, and starts listening for
-C<NameOwnerChanged> events.
-
-Those events are emitted when a client attaches or detaches from the
-bus. A client may die before releasing the idle inhibition, so we want
-to be notified when that happens, and release that inhibition.
-
-=cut
sub start($self) {
my $inhibit_cb = $self->curry::weak::_inhibit;
@@ -218,3 +159,86 @@ sub _prod_screensaver($self) {
}
1;
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+App::XScreenSaver::DBus::Saver - implements the "idle inhibition" protocol
+
+=head1 VERSION
+
+version 1.0.3
+
+=head1 SYNOPSIS
+
+ use Net::DBus::Reactor;
+ use App::XScreenSaver::DBus::InhibitSleep;
+
+ my $reactor = Net::DBus::Reactor->new;
+ my $s = App::XScreenSaver::DBus::Saver->new(reactor => $reactor);
+ $s->start;
+
+ $reactor->run;
+
+=head1 ATTRIBUTES
+
+=head2 C<reactor>
+
+the event loop
+
+=head2 C<bus>
+
+the DBus session bus
+
+=head2 C<dbus_srv>
+
+the DBus manager DBus service
+
+=head2 C<dbus_obj>
+
+the DBus manager DBus object
+
+=head2 C<service>
+
+the DBus service we export
+
+=head2 C<paths>
+
+the paths at which we export our DBus object
+
+there's two of them because different applications expect this object
+at different paths
+
+=head2 C<log>
+
+a logger
+
+=head1 METHODS
+
+=head2 C<start>
+
+Exports our object to the session bus, and starts listening for
+C<NameOwnerChanged> events.
+
+Those events are emitted when a client attaches or detaches from the
+bus. A client may die before releasing the idle inhibition, so we want
+to be notified when that happens, and release that inhibition.
+
+=head1 AUTHOR
+
+Gianni Ceccarelli <dakkar@thenautilus.net>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is Copyright (c) 2021 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+
+This is free software, licensed under:
+
+ The GNU Affero General Public License, Version 3, November 2007
+
+=cut
diff --git a/lib/App/XScreenSaver/DBus/SaverProxy.pm b/lib/App/XScreenSaver/DBus/SaverProxy.pm
index 858dcba..250d709 100644
--- a/lib/App/XScreenSaver/DBus/SaverProxy.pm
+++ b/lib/App/XScreenSaver/DBus/SaverProxy.pm
@@ -6,17 +6,9 @@ use experimental qw(signatures postderef);
# this is the interface name
use Net::DBus::Exporter qw(org.freedesktop.ScreenSaver);
use parent 'Net::DBus::Object';
-# VERSION
+our $VERSION = '1.0.3'; # VERSION
# ABSTRACT: proxy dbus object
-=head1 DESCRIPTION
-
-This is functionally the same as L<< C<Net::DBus::ObjectProxy> >>, but
-specialised for this application, and with a hack to allow L<<
-C<App::XScreenSaver::DBus::Saver> >> to access the sender of the
-message.
-
-=cut
dbus_method('Inhibit',['string','string'],['uint32']);
dbus_method('UnInhibit',['uint32'],[]);
@@ -44,3 +36,38 @@ sub UnInhibit($self,$cookie) {
}
1;
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+App::XScreenSaver::DBus::SaverProxy - proxy dbus object
+
+=head1 VERSION
+
+version 1.0.3
+
+=head1 DESCRIPTION
+
+This is functionally the same as L<< C<Net::DBus::ObjectProxy> >>, but
+specialised for this application, and with a hack to allow L<<
+C<App::XScreenSaver::DBus::Saver> >> to access the sender of the
+message.
+
+=head1 AUTHOR
+
+Gianni Ceccarelli <dakkar@thenautilus.net>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is Copyright (c) 2021 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+
+This is free software, licensed under:
+
+ The GNU Affero General Public License, Version 3, November 2007
+
+=cut
diff --git a/scripts/xscreensaver-dbus b/scripts/xscreensaver-dbus
index 23bc6cf..51ed55e 100755
--- a/scripts/xscreensaver-dbus
+++ b/scripts/xscreensaver-dbus
@@ -4,13 +4,27 @@ use warnings;
use v5.20;
use Log::Any::Adapter Stdout => ( log_level => 'debug' );
use App::XScreenSaver::DBus;
-# VERSION
+our $VERSION = '1.0.3'; # VERSION
# PODNAME: xscreensaver-dbus
# ABSTRACT: tie xscreensaver into dbus
$|++;
App::XScreenSaver::DBus->new->run;
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+xscreensaver-dbus - tie xscreensaver into dbus
+
+=head1 VERSION
+
+version 1.0.3
+
=head1 SYNOPSIS
xscreensaver &
@@ -46,9 +60,40 @@ So I wrote this.
=head1 REFERENCES
-=for :list
-* L<< Martin Lucina F<xscreensaver-systemd>|https://github.com/mato/xscreensaver-systemd >>
-* L<the Debian bug where the above program is first mentioned|https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781961>
-* L<"Is there a decent way to inhibit screensavers in linux?" on StackOverflow|https://stackoverflow.com/questions/460140/is-there-a-decent-way-to-inhibit-screensavers-in-linux>
-* L<the systemd "Inhibitor Locks" documentation|https://www.freedesktop.org/wiki/Software/systemd/inhibit/>
-* L<the "idle inhibition" spec|https://people.freedesktop.org/~hadess/idle-inhibition-spec/index.html>
+=over 4
+
+=item *
+
+L<< Martin Lucina F<xscreensaver-systemd>|https://github.com/mato/xscreensaver-systemd >>
+
+=item *
+
+L<the Debian bug where the above program is first mentioned|https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781961>
+
+=item *
+
+L<"Is there a decent way to inhibit screensavers in linux?" on StackOverflow|https://stackoverflow.com/questions/460140/is-there-a-decent-way-to-inhibit-screensavers-in-linux>
+
+=item *
+
+L<the systemd "Inhibitor Locks" documentation|https://www.freedesktop.org/wiki/Software/systemd/inhibit/>
+
+=item *
+
+L<the "idle inhibition" spec|https://people.freedesktop.org/~hadess/idle-inhibition-spec/index.html>
+
+=back
+
+=head1 AUTHOR
+
+Gianni Ceccarelli <dakkar@thenautilus.net>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is Copyright (c) 2021 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+
+This is free software, licensed under:
+
+ The GNU Affero General Public License, Version 3, November 2007
+
+=cut
diff --git a/t/00-compile.t b/t/00-compile.t
new file mode 100644
index 0000000..e810134
--- /dev/null
+++ b/t/00-compile.t
@@ -0,0 +1,100 @@
+use 5.006;
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058
+
+use Test::More;
+
+plan tests => 5 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
+
+my @module_files = (
+ 'App/XScreenSaver/DBus.pm',
+ 'App/XScreenSaver/DBus/Logind.pm',
+ 'App/XScreenSaver/DBus/Saver.pm',
+ 'App/XScreenSaver/DBus/SaverProxy.pm'
+);
+
+my @scripts = (
+ 'scripts/xscreensaver-dbus'
+);
+
+# no fake home requested
+
+my @switches = (
+ -d 'blib' ? '-Mblib' : '-Ilib',
+);
+
+use File::Spec;
+use IPC::Open3;
+use IO::Handle;
+
+open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
+
+my @warnings;
+for my $lib (@module_files)
+{
+ # see L<perlfaq8/How can I capture STDERR from an external command?>
+ my $stderr = IO::Handle->new;
+
+ diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
+ $^X, @switches, '-e', "require q[$lib]"))
+ if $ENV{PERL_COMPILE_TEST_DEBUG};
+
+ my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
+ binmode $stderr, ':crlf' if $^O eq 'MSWin32';
+ my @_warnings = <$stderr>;
+ waitpid($pid, 0);
+ is($?, 0, "$lib loaded ok");
+
+ shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
+ and not eval { +require blib; blib->VERSION('1.01') };
+
+ if (@_warnings)
+ {
+ warn @_warnings;
+ push @warnings, @_warnings;
+ }
+}
+
+foreach my $file (@scripts)
+{ SKIP: {
+ open my $fh, '<', $file or warn("Unable to open $file: $!"), next;
+ my $line = <$fh>;
+
+ close $fh and skip("$file isn't perl", 1) unless $line =~ /^#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
+ @switches = (@switches, split(' ', $1)) if $1;
+
+ close $fh and skip("$file uses -T; not testable with PERL5LIB", 1)
+ if grep { $_ eq '-T' } @switches and $ENV{PERL5LIB};
+
+ my $stderr = IO::Handle->new;
+
+ diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
+ $^X, @switches, '-c', $file))
+ if $ENV{PERL_COMPILE_TEST_DEBUG};
+
+ my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-c', $file);
+ binmode $stderr, ':crlf' if $^O eq 'MSWin32';
+ my @_warnings = <$stderr>;
+ waitpid($pid, 0);
+ is($?, 0, "$file compiled ok");
+
+ shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
+ and not eval { +require blib; blib->VERSION('1.01') };
+
+ # in older perls, -c output is simply the file portion of the path being tested
+ if (@_warnings = grep { !/\bsyntax OK$/ }
+ grep { chomp; $_ ne (File::Spec->splitpath($file))[2] } @_warnings)
+ {
+ warn @_warnings;
+ push @warnings, @_warnings;
+ }
+} }
+
+
+
+is(scalar(@warnings), 0, 'no warnings found')
+ or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
+
+
diff --git a/t/author-pod-spell.t b/t/author-pod-spell.t
new file mode 100644
index 0000000..0da45ac
--- /dev/null
+++ b/t/author-pod-spell.t
@@ -0,0 +1,35 @@
+
+BEGIN {
+ unless ($ENV{AUTHOR_TESTING}) {
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
+ }
+}
+
+use strict;
+use warnings;
+use Test::More;
+
+# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005
+use Test::Spelling 0.12;
+use Pod::Wordlist;
+
+
+add_stopwords(<DATA>);
+all_pod_files_spelling_ok( qw( bin lib ) );
+__DATA__
+App
+Ceccarelli
+DBus
+Gianni
+Logind
+Saver
+SaverProxy
+XScreenSaver
+dakkar
+dbus
+lib
+logind
+scripts
+specialised
+xscreensaver
diff --git a/t/author-pod-syntax.t b/t/author-pod-syntax.t
new file mode 100644
index 0000000..2233af0
--- /dev/null
+++ b/t/author-pod-syntax.t
@@ -0,0 +1,15 @@
+#!perl
+
+BEGIN {
+ unless ($ENV{AUTHOR_TESTING}) {
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
+ }
+}
+
+# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
+use strict; use warnings;
+use Test::More;
+use Test::Pod 1.41;
+
+all_pod_files_ok();
diff --git a/weaver.ini b/weaver.ini
deleted file mode 100644
index 2a9dfc0..0000000
--- a/weaver.ini
+++ /dev/null
@@ -1,50 +0,0 @@
-[@CorePrep]
-
-[-SingleEncoding]
-
-[Region / stopwords]
-flatten = 0
-
-[Name]
-[Version]
-
-[Region / prelude]
-
-[Generic / SYNOPSIS]
-[Generic / DESCRIPTION]
-[Generic / OVERVIEW]
-
-[Collect / ATTRIBUTES]
-command = attr
-
-[Collect / COLUMNS]
-command = column
-
-[Collect / RELATIONSHIPS]
-command = rel
-
-[Collect / REQUIRED METHODS]
-command = require
-
-[Collect / METHODS]
-command = method
-
-[Collect / MODIFIED METHODS]
-command = modif
-
-[Collect / FUNCTIONS]
-command = func
-
-[Collect / TYPES]
-command = type
-
-[Leftovers]
-
-[Region / postlude]
-
-[Authors]
-[Legal]
-
-[-Transformer / Lists]
-transformer = List
-format_name = list