Random Wallpaper

Yes – it’s simply not set by the shell that PipeRead invokes. Your better bet is to use a perl wrapper, invoke a separate script entirely which uses FvwmCommand (don’t bother, it’s silly) or use fbset, which has a randomise flag to it (fbset -r).

Much better.

– Thomas Adam

Yep.

In case you don’t want perl, you can still use bash like this:

#!/bin/bash
# Reads a given directory and set a random
# wallpaper using the images on that dir.

if [[ -d "${WALLPAPERDIR}" ]]
then
        files=$(ls "${WALLPAPERDIR}")
        file_matrix=($files)
        num_files=${#file_matrix[*]}
        FvwmCommand "user_ChangeWallpaper "${WALLPAPERDIR}/${file_matrix[$((RANDOM%num_files))]}""
fi

exit 0

Of course, you need to make sure that FvwmCommandS is loaded.

EDIT; Also change “user_ChangeWallpaper” by the correct command of function you use to do such task.