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

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