X11::Wallpaper - set X11 wallpaper using best available helper program
version 1.1
use X11::Wallpaper qw(set_wallpaper); set_wallpaper( "./foo.jpg", { mode => 'full', # default, or: aspect, center, tile setter => 'feh', # override setter display => ':0.0' # override X display } ); my @cmd = set_wallaper_command(...); # just give me the command
This module provides an interface for setting the background on X11 systems, by recruiting a suitable helper script (feh, Esetroot, hsetroot, chbg, xli etc.) and providing appropriate options.
Sets $image_path as the desktop wallpaper. The following args are supported:
$image_path
May be 'full' (fullscreen, stretched to fit - the default), 'tile', 'center' (do not stretch) or 'aspect' (fullscreen, preserving aspect ratio). For the latter two options, the background for any borders around the image is set to black.
Manually specify the program to use, e.g. 'qiv', provided it is in this module's dictionary of commands.
Override the X display to use, e.g. ':0.0'. Otherwise defaults to the value of the DISPLAY environment variable.
As with set_wallpaper, except returns the command (as a list of arguments) instead of executing it.
set_wallpaper
Inspired by the awsetbg shell script by Julian Danjou, which in turn is derived from fbsetbg by Han Boetes.
awsetbg
fbsetbg
Skip the middle man and code against the X11 libraries directly. But that wouldn't be quite as portable...
Richard Harris <RJH@cpan.org>
This software is copyright (c) 2012 by Richard Harris.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install X11::Wallpaper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm X11::Wallpaper
CPAN shell
perl -MCPAN -e shell install X11::Wallpaper
For more information on module installation, please visit the detailed CPAN module installation guide.