File Coverage

blib/lib/X11/Muralis/Backend/Hsetroot.pm
Criterion Covered Total %
statement 6 23 26.0
branch 0 14 0.0
condition 0 3 0.0
subroutine 2 4 50.0
pod 2 2 100.0
total 10 46 21.7


line stmt bran cond sub pod time code
1             package X11::Muralis::Backend::Hsetroot;
2             $X11::Muralis::Backend::Hsetroot::VERSION = '0.1002';
3 2     2   3026 use strict;
  2         2  
  2         46  
4 2     2   7 use warnings;
  2         2  
  2         385  
5              
6             our @ISA = qw(X11::Muralis::Backend);
7              
8             =head1 NAME
9              
10             X11::Muralis::Backend:Hsetroot - use hsetroot to display images on the desktop.
11              
12             =head1 VERSION
13              
14             version 0.1002
15              
16             =head1 SYNOPSIS
17              
18             muralis --use Hsetroot
19              
20             =head1 DESCRIPTION
21              
22             This is a backend for muralis which uses the hsetroot program
23             to display images on the desktop.
24              
25             =cut
26              
27             =head1 METHODS
28              
29             =head2 new
30              
31             =cut
32              
33             sub new {
34 0     0 1   my $class = shift;
35 0           my %parameters =
36             (
37             prog => 'hsetroot',
38             can_do => {
39             tile => 1,
40             fullscreen => 1,
41             stretch => 1,
42             centre => 1,
43             },
44             @_
45             );
46 0   0       my $self = bless ({%parameters}, ref ($class) || $class);
47 0           return ($self);
48             } # new
49              
50             =head2 display
51              
52             $self->display($filename, %args);
53              
54             =cut
55              
56             sub display {
57 0     0 1   my $self = shift;
58 0           my $filename = shift;
59 0           my %args = (
60             @_
61             );
62              
63 0           my $options = '';
64 0 0         $options = " -tile" if $args{tile};
65 0 0         $options = " -full" if $args{fullscreen};
66 0 0         $options = " -fill" if $args{stretch};
67 0 0         $options = " -center" if $args{center};
68 0 0         $options = " -tile" if (!$options);
69 0 0         $options = $args{option} . ' ' . $options if $args{option};
70 0           my $command = "$self->{prog} $options '$filename'";
71 0 0         print STDERR $command, "\n" if $args{verbose};
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; # End of X11::Muralis::Backend::Hsetroot
142             __END__