トップ «前の日記(2012年06月28日) 最新 次の日記(2012年07月08日)» 編集

Masa's blog

検索キーワード:

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.