zufall − a simple program to change the background periodically.
zufall [options] /path/to/imagedir-or-file [/path/to/imagedir-or-file]
zufall takes one or more images or directories with images as a parameter 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 is possible to execute a command when the image changes.
By default one image is shown on each monitor.
−d, −−delay=delay
number of seconds an image is shown (default 900)
-M, multi-head=MODE
specifies the method of placing images if more than one monitor is available. MODE can be per_screen, stretch or clone (default per_screen)
−s −−maxscale=percent
maximum percent the image will be scaled (default 150)
−b −−minborder=pixel
ignore −−maxscale if the remaining border would be smaller than pixel (default 100)
−m −−minsize=kilobyte
only show images bigger than kilobyte. A size of 0 shows all images (default 0)
−l −−list=file
load list of images from file
• the format of the file is one directory or file per line
• file can also be a collection from geeqie
• if file is −, the list will be read from stdin
−S −−sequential
don’t randomize the imagelist. This is useful with −l, or if you want to see the images directory-wise.
−c −−command=command
execute command on every picture change. Within command
%c |
gets replaced with the background−color |
|||
%f |
gets replaced with the image−filename |
|||
%w |
gets replaced with the scaled width |
|||
%h |
gets replaced with the scaled height |
|||
%% |
gets replaced with % |
Mind the quoting, the command is interpreted by the shell. malicious filenames could execute further commands!
−n −−no−set
don’t set the background (but execute command if given)
−p −−passes=passes
exit after given number of images
−−help |
display help and exit |
−−version
output version information and exit
HUP |
change background |
|||
USR1 |
output some info |
|||
TERM |
exit |
zufall can not be used directly to set the background in Gnome. This is because Gnome covers the root window, so the background can not be seen.
To randomize the background in Gnome, the distribution contains the wrapper script zufall-gnome to set the background via gconftool-2. It takes the same parameters as zufall. Note that the image scaling of zufall will not work when using zufall-gnome, because theres no way to set a specific size via gconftool-2.
If zufall is started within Xfce, xfdesktop will give up the desktop completely (including desktop menus), but no background image will be shown. However, Xfce is able to change to a random background that it gets from a file by itself. With this mechanism zufall could be used to manage the picture changes, but there seems to be no good solution to set the desktop color and size of the image with zufall.
To try out what the −c option does:
zufall /path/to/images −n −c ’echo −e \
“filename\t: %f\ncolor \t: %c\nscaled res\t: %wx%h\n“’
To append the name of the current image to a file:
zufall /path/to/images −c ’echo “%f“ >> /tmp/imagehistory’
To view random images in geeqie:
zufall /path/to/images −n −c ’geeqie −r “%f“’
To get a list of files from another program (GNU find in this case)
find /path/to/images −type f −not -regex ’.*/pi/.*’ | zufall −l −
Bind pkill -1 zufall to a key or put it in a launcher to change the background with a keypress.
How portable is it? Please tell me if you can(’t) get it to run under anything else than GNU/Linux or FreeBSD! Especially signal(2) could be a problem.
Please send bug reports and feedback to the author.
geeqie(1) gconftool-2(1)
Moritz
Orbach <zufall@apfelboymchen.net>
http://apfelboymchen.net/gnu/C/zufall/