=pod

=head2 NAME

 icewmbg - a desktop background image manager for IceWM

=head2 SYNOPSIS

B<icewmbg> [I<OPTIONS>] [I<ARGUMENTS>]

=head2 DESCRIPTION

B<icewmbg> can assign a colour or image to the I<X11> desktop background.
Common image formats are supported.  Each L<icewm(1)> workspace can have
its own background.

When the background image changes, B<icewmbg> can be notified to
update the background.  When switching workspaces, it checks the image
file modification time.  If it has changed, it reloads the image.

B<icewmbg> supports semitransparency.  Semitransparent background
images and colours can be configured.

It uses RandR or Xinerama to support backgrounds on all connected
monitors.  When monitors appear/disappear, or change their resolution,
B<icewmbg> will adjust.  It supports an option for one large background
over all monitors.

It will update the C<_ICEWMBG_IMAGE> property of the root window to the
path of the background image whenever it changes the desktop background.

B<icewmbg> is started automatically by L<icewm-session(1)>.
If there is just a single background for all workspaces, icewmbg may
conclude that it can safely exit after setting the desktop background,
to free its system memory.  If the screen size changes, icewm will then
attempt to restart icewmbg, preferably via icewm-session.

=head2 ARGUMENTS

=head2 SPECIFIC OPTIONS

Where multiple values can be given for images
or colours, they are separated by comma's.
Each such value may be enclosed in double quotes.
If I<FILE> is a directory, all images
from that directory are used in sorted order.
If the value starts with an exclamation mark, as in I<!FILE>,
the images from the directory I<FILE> are permuted randomly.
Image file names or directory names may have L<glob(7)> wildcards,
or they may start with a tilde or environment variable.

=over

=item B<-f>, B<--fork>

Fork into the background and detach from the terminal.

=item B<-p>, B<--replace>

Replace an existing B<icewmbg>. If there is a running B<icewmbg>,
it is instructed to quit.  The new B<icewmbg> will take over.

=item B<-q>, B<--quit>

Tell the running B<icewmbg> to quit. This option is used by
L<icewm-session(1)> when L<icewm(1)> exits.

=item B<-r>, B<--restart>

Tell the running B<icewmbg> to restart itself.  This is useful when
settings in have changed. If no icewmbg is active, it starts one.

=item B<-u>, B<--shuffle>

Shuffle the list of background images randomly.
This option may be given again whenever the running
B<icewmbg> should reshuffle its list of background images.

=item B<-c>, B<--config>=I<FILE>

Load preferences from I<FILE>.

=item B<-t>, B<--theme>=I<THEME>

Use the theme named I<THEME>.

=item B<-i>, B<--image>=I<FILE>[,I<FILE>]*

Load background images from each I<FILE>.
This overrules the C<DesktopBackgroundImage> preference.
When more than one image is given, they are assigned
to each workspace in the given order.

=item B<-k>, B<--color>=I<COLOR>[,I<COLOR>]*

Use background colours from each I<COLOR>.
This overrules the C<DesktopBackgroundColor> preference.

=item B<-s>, B<--semis>=I<FILE>[,I<FILE>]*

Load transparency images from each I<FILE>.
This overrules the C<DesktopTransparencyImage> preference.

=item B<-x>, B<--trans>=I<NAME>[,I<NAME>]

Use transparency colours for each I<NAME>.
This overrules the C<DesktopTransparencyColor> preference.

=item B<-e>, B<--center>={I<0>|I<1>}

Disable/Enable centring background.
This overrules the C<DesktopBackgroundCenter> preference.

=item B<-a>, B<--scaled>={I<0>|I<1>}

Disable/Enable scaling background.
This overrules the C<DesktopBackgroundScaled> preference.

=item B<-m>, B<--multi>={I<0>|I<1>}

Disable or enable a single background over all monitors.
This overrules the C<DesktopBackgroundMultihead> preference.

=item B<-y>, B<--cycle>=I<SECONDS>

Cycle over the list of background images every I<SECONDS>.
This overrules the C<CycleBackgroundsPeriod> preference.

=item B<-o>, B<--output=FILE>

Redirect all output to I<FILE>.
A leading tilde or environment variable is expanded.

=item B<--postpreferences>

Print a list of all preference values that B<icewmbg> will use.

=item B<--verbose>

Print a log of actions and some events.

=back

=head2 GENERAL OPTIONS

=over

=item B<-d>, B<--display>=I<DISPLAY>

Use I<DISPLAY> to connect to the X server.
Otherwise use DISPLAY from the environment.

=item B<-h>, B<--help>

Print a brief usage statement to F<stdout> and exit.

=item B<-V>, B<--version>

Print the program version to F<stdout> and exit.

=item B<-C>, B<--copying>

Print copying permissions to F<stdout> for the program and exit.

=item B<--sync>

Use a slow synchronous mode to communicate with the I<X11> server.

=item B<--verbose>

Report on some of the activities.

=head2 FILES

Additional arguments, which either are a path or which have an image
extension, are assumed to be background image files or directories.

=back

=head2 PREFERENCES

By default B<icewmbg> loads settings from the L<icewm(1)>
preferences file. See L<icewm-preferences(5)> for details.
The settings read are:

  DesktopBackgroundCenter    - Display desktop background centered
  DesktopBackgroundScaled    - Display desktop background scaled
  DesktopBackgroundColor     - Desktop background color(s)
  DesktopBackgroundImage     - Desktop background image(s)
  ShuffleBackgroundImages    - Shuffle the list of background images
  SupportSemitransparency    - Support for semitransparent terminals
  DesktopTransparencyColor   - Semitransparency background color(s)
  DesktopTransparencyImage   - Semitransparency background image(s)
  DesktopBackgroundMultihead - One background over all monitors
  CycleBackgroundsPeriod     - Seconds between cycling over backgrounds

If these settings are set in the F<preferences> file, they can
be overridden by the theme in the theme defaults file.
To enforce a certain setting, set it in the F<prefoverride> file instead.
See L<icewm-prefoverride(5)>.

=head2 WORKSPACES

Each workspace can have a unique image. Specify multiple images to
B<DesktopBackgroundImage> separated by comma's.  Or give at least one
directory with images. The images are assigned to each workspace in
the order given. When icewm changes workspace, the running icewmbg
will adapt the desktop background to the assigned image.

If you specify more images then there are workspaces, then
B<CycleBackgroundsPeriod> can set a period. When the period expires,
icewmbg will switch to the next set of images. If you give less images
than there are workspaces, then icewmbg will reuse previous images
for the remaining workspaces.

=head2 IMAGE SCALING

Often a background image has a different width or height than the screen.
The image can then be replicated (tiled), centered or scaled. This is
controlled by C<DesktopBackgroundCenter> and C<DesktopBackgroundScaled>.
What happens for their combination is given by the following table:

  center:0 scaled:0 = The background is replicated in both directions.
  center:1 scaled:0 = The background is centered, but not scaled.
  center:1 scaled:1 = Fill one dimension and preserve the aspect ratio.
  center:0 scaled:1 = Fill both dimensions and preserve the aspect ratio.

=head2 EXAMPLES

    # For four unique desktop backgrounds for four workspaces do:

    icewmbg -f -p -i image0,image1,image2,image3

    # Or create a directory with the four images and do:

    icewmbg -f -p -i /path/to/directory

    # The images should have proper image filename extensions.

=head2 SIGNALS

B<icewmbg> supports the following signals:

=over

=item B<SIGHUP>

B<icewmbg> will restart itself.

=item B<SIGINT>, B<SIGTERM>

B<icewmbg> will terminate.

=item B<SIGUSR1>

B<icewmbg> will reshuffle the list of background images and
update the backgrounds of all workspaces.

=back

=head2 SEE ALSO

L<icewm(1)>,
L<icewm-preferences(5)>,
L<icewm-prefoverride(5)>,
L<wmsetbg(1)>,
L<xsetbg(1)>,
L<xwallpaper(1)>.

=head2 BUGS

Please report bugs at L<https://github.com/ice-wm/icewm/issues>.

=head2 AUTHOR

Brian Bidulock L<mailto:bidulock@openss7.org>.

See B<--copying> for full copyright notice and copying permissions.

=head2 LICENSE

B<IceWM> is licensed under the GNU Library General Public License.
See the F<COPYING> file in the distribution or use the B<--copying> flag
to display copying permissions.

=cut

# vim: set sw=4 tw=72 nocin spell spelllang=en_ca:
