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


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

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

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

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.