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