#!/bin/sh set -e resolution="$1" # e.g. 800x600x24 (width x height x bits_per_pixel) shift # the following arguments are the program to execute and its arguments bg="$(mktemp tmp.XXXXXXXXXX.xbm)" twm_cfg="$(mktemp tmp.XXXXXXXXXX_twm.cfg)" twm_session_dir="$(mktemp -d)" anim="$(mktemp -d)" # Create checkerboard background # Use +level-colors 'gray(192),gray(128)' to choose directly the colors. # Since we're creating an .xbm for xsetroot, we'll use black and white # and choose the colors with xsetroot. convert -size "$(echo "$resolution" | cut -d 'x' -f1-2)" \ tile:pattern:checkerboard \ -auto-level \ "$bg" cat > "$twm_cfg" <