NAME

Gnome2::Backgrounds - Helper module for managing wallpapers in GNOME

VERSION

version 0.02

SYNOPSIS

use feature 'say';
use Gnome2::Backgrounds;

my $backgrounds = Gnome2::Backgrounds -> new;

# print a list of filenames of JPEG backgrounds
my $jpg_bg = $backgrounds -> backgrounds('.jpg');

foreach (@$jpg_bg) {
  say $_ -> {'filename'};
}

# set the default background
$backgrounds -> set('my_background.jpg');

# or
$backgrounds -> set('/path/to/my_background.jpg');

DESCRIPTION

Gnome2::Backgrounds is a simple module to help managing wallpapers under the GNOME2 desktop environment.

METHODS

new( config => 'some/file/backgrounds.xml' )

Parses a backgrounds.xml file (default $HOME/.gnome2/background.xml) and returns a Gnome2::Backgrounds object.

backgrounds( $name )

Returns a list of backgrounds matching $name. The backgrounds are stored as anonymous hashes containing the following fields:

name

Backgrounds name (typically the basename of the background's path).

filename

Picture file name (absolute path of the image file).

options

Picture options. Can be: zoom, wallpaper, centered, scaled, stretched or spanned.

shade_type

Color shading type. Can be: solid, horizontal-gradient or vertical-gradient.

pcolor

Primary color.

scolor

Secondary color.

deleted

Whether the background has been removed or not.

set( $background )

Sets $background (where $background is a valid background name, or the path to an image file) as default background using GConf.

current( )

Returns the background currently used, in the form of a hash reference (see backgrounds() for more info).

AUTHOR

Alessandro Ghedini <alexbio@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2011 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.