blib/lib/X11/Muralis/Backend/Hsetroot.pm

filter: Statementstmt 34.6% 9 / 26 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 2 / 4 Podpod 100% 2 / 2 totaltotal 25.4% 13 / 51 CC 9 SCAR 39.0
CC
9
Cov
21%
display
72.0
new
6.0
BEGIN
1.0
CRAP 49.2
« blib/lib/X11/Muralis/Backend/Xsri.pm ↑ Summary blib/lib/X11/Muralis/Backend/Qiv.pm »
1 package X11::Muralis::Backend::Hsetroot;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our @ISA = qw(X11::Muralis::Backend);
6  
7 =head1 NAME
8  
9 X11::Muralis::Backend:Hsetroot - use hsetroot to display images on the desktop.
10  
11 =head1 VERSION
12  
13 This describes version B<0.1001> of X11::Muralis::Backend::Hsetroot.
14  
15 =cut
16  
17 1 our $VERSION = '0.1001';
18  
19 =head1 SYNOPSIS
20  
21 muralis --use Hsetroot
22  
23 =head1 DESCRIPTION
24  
25 This is a backend for muralis which uses the hsetroot program
26 to display images on the desktop.
27  
28 =cut
29  
30 =head1 METHODS
31  
32 =head2 new
33  
34 =cut
35  
36 sub new {
37 0 ▶ my $class = shift;
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
38 0 my %parameters =
39 (
40 prog => 'hsetroot',
41 can_do => {
42 tile => 1,
43 fullscreen => 1,
44 stretch => 1,
45 centre => 1,
46 },
47 @_
48 );
49 0 ▶ my $self = bless ({%parameters}, ref ($class) || $class);
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
50 0 return ($self);
51 } # new
52  
53 =head2 display
54  
55 $self->display($filename, %args);
56  
57 =cut
58  
59 sub display {
60 0 ▶ my $self = shift;
Subroutine display: not called CC=8 SCAR=42.8
Pod documented
61 0 my $filename = shift;
62 0 my %args = (
63 @_
64 );
65  
66 0 my $options = '';
67 0 ▶ $options = " -tile" if $args{tile};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"tile"} 0 0 0
68 0 ▶ $options = " -full" if $args{fullscreen};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"fullscreen"} 0 0 0
69 0 ▶ $options = " -fill" if $args{stretch};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"stretch"} 0 0 0
70 0 ▶ $options = " -center" if $args{center};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"center"} 0 0 0
71 0 ▶ $options = " -tile" if (!$options);
Branch: 1 branch
BranchTrueFalseTotal
unless $options 0 0 0
72 0 ▶ $options = $args{option} . ' ' . $options if $args{option};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"option"} 0 0 0
73 0 my $command = "$self->{prog} $options '$filename'";
74 0 ▶ print STDERR $command, "\n" if $args{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"verbose"} 0 0 0
75 0 system($command);
76 } # display
77  
78 =head1 REQUIRES
79  
80 Test::More
81  
82 =head1 INSTALLATION
83  
84 To install this module, run the following commands:
85  
86 perl Build.PL
87 ./Build
88 ./Build test
89 ./Build install
90  
91 Or, if you're on a platform (like DOS or Windows) that doesn't like the
92 "./" notation, you can do this:
93  
94 perl Build.PL
95 perl Build
96 perl Build test
97 perl Build install
98  
99 In order to install somewhere other than the default, such as
100 in a directory under your home directory, like "/home/fred/perl"
101 go
102  
103 perl Build.PL --install_base /home/fred/perl
104  
105 as the first step instead.
106  
107 This will install the files underneath /home/fred/perl.
108  
109 You will then need to make sure that you alter the PERL5LIB variable to
110 find the modules, and the PATH variable to find the script.
111  
112 Therefore you will need to change:
113 your path, to include /home/fred/perl/script (where the script will be)
114  
115 PATH=/home/fred/perl/script:${PATH}
116  
117 the PERL5LIB variable to add /home/fred/perl/lib
118  
119 PERL5LIB=/home/fred/perl/lib:${PERL5LIB}
120  
121 =head1 SEE ALSO
122  
123 perl(1).
124  
125 =head1 BUGS
126  
127 Please report any bugs or feature requests to the author.
128  
129 =head1 AUTHOR
130  
131 Kathryn Andersen RUBYKAT
132 perlkat AT katspace DOT org
133 www.katspace.org
134  
135 =head1 COPYRIGHT AND LICENCE
136  
137 Copyright (c) 2008 by Kathryn Andersen
138  
139 This program is free software; you can redistribute it and/or modify it
140 under the same terms as Perl itself.
141  
142 =cut
143  
144 1 1; # End of X11::Muralis::Backend::Hsetroot
145 __END__
« blib/lib/X11/Muralis/Backend/Xsri.pm ↑ Summary blib/lib/X11/Muralis/Backend/Qiv.pm »