2012年07月06日 cacaview for w3m [長年日記]
_ cacaview for w3m
cacaview.sh
#! /bin/sh
file=`file $1`
if [ "X`echo ${file}|egrep ' GIF '`" != "X" ]
then
cat $1 |\
giftopnm |\
ppmtobmp >/tmp/cacaview.sh.$$.tmp
elif [ "X`echo ${file}|egrep ' JPEG '`" != "X" ]
then
cat $1 |\
jpegtopnm |\
ppmtobmp >/tmp/cacaview.sh.$$.tmp
elif [ "X`echo ${file}|egrep ' PNG '`" != "X" ]
then
cat $1 |\
pngtopnm |\
ppmtobmp >/tmp/cacaview.sh.$$.tmp
fi
cacaview /tmp/cacaview.sh.$$.tmp
rm -f /tmp/cacaview.sh.$$.tmp
You may think that I had better to use convert to change some image format to BMP, but BMP file which is created by convert is not recognized by cacaview :(
I'm not sure why...
~/.w3m/mailcap
image/*; cacaview.sh %s ;needsterminal
type "I" to see image on link.
[ツッコミを入れる]