#!/bin/sh # # View an X-Face icon in mail or news # trap 'r=$?; rm -f $tmpfile; exit $r' 0 1 2 3 13 15 tmpfile=$(mktemp ~/.showxface.XXXXXX) || exit 1 cat >$tmpfile; [ -s $tmpfile ] || exit 1 face=$(nawk ' /^[Xx]-[Ff]ace: / { sub(/^[Xx]-[Ff]ace: /, ""); print; started=1; next } /^[^ ]/ { if (started) exit } /^$/ { if (started) exit } { if (started) print }' $tmpfile) || exit 1 [ -z "$face" ] && exit 1 echo "$face" | uncompface | ikontopbm >$tmpfile mmwrapper $tmpfile .