The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

newbg - Set wallpaper like no-one's business

SYNOPSIS

  newbg [-d|-D subdir] [-v] [-n] [--list] [keywords...]

  echo 'root: /home/user/wallpapers' >> ~/.newbg

  newbg                # random wallpaper
  newbg -d animals     # random wallpaper from animals subdir
  newbg dinosaur       # random wallpaper with dinosaur in filename

  # Adjust brightness
  newbg --darken [10] | --lighten [10]

  # View current wallpaper or history
  newbg [--current | --history]

  # Restore previous wallpaper on startup
  newbg -r

DESCRIPTION

newbg is a simple utility to set the desktop wallpaper. Given a directory of wallpaper images, it will pick a random image subject to the subdirectory or filename restrictions you provide, and set it as background. It keeps track of previously set images and will cycle through them to avoid duplicates.

newbg keeps track of how long a wallpaper has been active and will be less likely to suggest wallpapers you change after a short amount of time.

Additionally, newbg can normalise the brightness of wallpapers and output a history of previously set images.

OPTIONS

keywords

Pick wallpapers in which the filename contains at least one of the keywords provided. Case-insensitive.

-d, --dir subdir

Specify the directory in which to look for a wallpaper. This directory is assumed to be a sub-directory of the root directory (see above), unless it begins with a slash ('/').

-D subdir

As -d, except assume the directory is relative to the current working directory if it does not begin with a slash.

-r, --restore

Restore previously set wallpaper, without counting statistics. This is intended for use at startup.

--darken[=adjustment]

Darken the current wallpaper. The default adjustment is 10, but can be set. Your adjustment will be saved and applied when the wallpaper is picked again.

--brighten[=adjustment]

Brighten the current wallpaper (as above).

-n, --no-stats

Usually newbg will remember if you immedately switch to another wallpaper (by re-running the command) or seem to be happy with a wallpaper (but not re-running for a while) and factor this into future selections. This option disables this behaviour for the current invocation.

-l, --list

List wallpapers that could be picked, but don't set any.

--history

Show current and previously set wallpapers, with time since they were set.

--current

Print path of current wallpaper.

-v, --verbose

Output the filename of the selected wallpaper, and some other information.

--config path

Override path to the newbg config file.

CONFIGURATION

newbg's configuration is by default stored in $HOME/.newbg in YAML format. You can override this via either the --config option or the NEWBG_CONFIG environment variable.

The config file is used to store data about previous wallpaper selections and user preferences e.g. brightness adjustments. The following top-level keys may be set:

root

Path to the root directory of the user's wallpapers. Required.

brightness

Target average intensity of pixels in the wallpaper, as a floating point number [0,1]. If this config is set, images will have their brightness adjusted such that the average intensity becomes this value.

data.$hash

Holds configuration for each wallpaper, by SHA-1 hash of its contents. Relevant keys are 'good' (number of good votes), 'bad' (number of bad votes) and 'bright_adjust' (user-specified brightness adjustment for image).

AUTHOR

Richard Harris <richardjharris@gmail.com>

COPRIGHT AND LICENSE

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.