This is a simple program to change the background periodically.
It takes one or more directories with images as a parameter (no GUI) and sets a randomly chosen image as background. If there is a border remaining, its color is the average color of two corners of the image. This mostly fits the image very well.
It doesn't work if the root-window is hidden by another program, like in Gnome or KDE. However, it is possible to execute a command when the image changes and set the background this way (for example via gconftool). Of course this can also be used for other things, like calling a program that announces your new background-image on IRC. But please don't do that. See below for examples.
- Usage
- zufall /path/to/image-directory-or-file [/path/to/image-directory-or-file]
Parameter (same as --help):
-d, --delay=DELAY number of seconds an image is shown (default 900)
-s --maxsize=PERCENT maximum size in percent (default 150)
-b --minborder=PIXEL ignore --maxsize if the remaining border would be
smaller than --minborder (default 100)
-l --list=FILE load list of images from file
- format is one directory or file per line
(absolute path!)
- can also be a collection from gqview
-S --sequential don't randomize the imagelist (useful with -l)
-c --command=COMMAND execute COMMAND on every picture change
%c gets replaced with the color
%i gets replaced with the image
%w gets replaced with the scaled width
%h gets replaced with the scaled height
%% gets replaced with %
-n --no-set don't set the background
(but execute command if given)
-p --passes=PASSES exit after given number of images
--help display this help and exit
--version output version information and exit
- SIGNALS
- HUP change background USR1 info TERM exit
Note that the "USR1" memory-info only prints the memory used for the pathnames.
Bind "pkill -1 zufall" to a key or put it in a launcher to change the background with a keypress.
- Examples
To try out what the -c option does:
zufall /path/to/images -n -c 'echo "picture: %i color: %c scaled res: %wx%h"'
To append the name of the current image to a file: zufall /path/to/images -c 'echo "%i" >> /tmp/imagehistory'
To view random images in gqview:
zufall /path/to/images -c 'gqview -r "%i"'
To set the background in gnome with the help of gconftool:
zufall /path/to/images -n -c '
gconftool-2 -s /desktop/gnome/background/picture_filename -t string "%i";\
gconftool-2 -s /desktop/gnome/background/primary_color -t string "%c"'
- Unfortunately there seems to be no key for scaling the image.
- I'm sure there is something similar for KDE.
- Mind the quoting, the command is executed in a shell!
Send bugreports and comments to <zufall@apfelboymchen.homeunix.net>
