3 # mhn.defaults.sh -- create extra profile file for MIME handling
5 # USAGE: mhn.defaults.sh [ search-path [ search-prog ]]
7 # If a search path is passed to the script, we
8 # use that, else we use a default search path.
12 SEARCHPATH="$PATH:/usr/demo/SOUND"
15 # If a search program is passed to the script, we
16 # use that, else we use a default search program.
20 SEARCHPROG="mhn.find.sh"
23 # put output into a temporary file, so we
24 # can sort it before output.
26 trap "rm -f $TMP" 0 1 2 3 13 15
28 echo "mhstore-store-text: %m%P.txt" >> $TMP
29 echo "mhstore-store-text/richtext: %m%P.rt" >> $TMP
30 echo "mhstore-store-video/mpeg: %m%P.mpg" >> $TMP
31 echo "mhstore-store-application/PostScript: %m%P.ps" >> $TMP
33 PGM="`$SEARCHPROG $SEARCHPATH xwud`"
34 if [ ! -z "$PGM" ]; then
35 XWUD="$PGM" X11DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
40 PGM="`$SEARCHPROG $SEARCHPATH pbmtoxwd`"
41 if [ ! -z "$PGM" ]; then
42 PBM="$PGM" PBMDIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
47 PGM="`$SEARCHPROG $SEARCHPATH xv`"
48 if [ ! -z "$PGM" ]; then
49 echo "mhshow-show-image: %p$PGM -geometry =-0+0 '%f'" >> $TMP
50 elif [ ! -z $"PBM" -a ! -z "$XWUD" ]; then
51 echo "mhshow-show-image/gif: %p${PBMDIR}giftoppm | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
52 echo "mhshow-show-image/x-pbm: %p${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
53 echo "mhshow-show-image/x-pgm: %p${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
54 echo "mhshow-show-image/x-ppm: %p${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
55 echo "mhshow-show-image/x-xwd: %p$XWUD -geometry =-0+0" >> $TMP
57 PGM="`$SEARCHPROG $SEARCHPATH djpeg`"
58 if [ ! -z "$PGM" ]; then
59 echo "mhshow-show-image/jpeg: %p$PGM -Pg | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
63 if [ -f "/dev/audioIU" ]; then
64 PGM="`$SEARCHPROG $SEARCHPATH recorder`"
65 if [ ! -z "$PGM" ]; then
66 echo "mhstore-store-audio/basic: %m%P.au" >> $TMP
67 echo "mhbuild-compose-audio/basic: ${AUDIODIR}recorder '%f' -au -pause > /dev/tty" >> $TMP
68 echo "mhshow-show-audio/basic: %p${AUDIODIR}splayer -au" >> $TMP
70 elif [ -f "/dev/audio" ]; then
71 PGM="`$SEARCHPROG $SEARCHPATH raw2audio`"
72 if [ ! -z "$PGM" ]; then
73 AUDIODIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
74 echo "mhstore-store-audio/basic: | ${AUDIODIR}raw2audio -e ulaw -s 8000 -c 1 > %m%P.au" >> $TMP
75 echo "mhstore-store-audio/x-next: %m%P.au" >> $TMP
76 AUDIOTOOL="`$SEARCHPROG $SEARCHPATH audiotool`"
77 if [ ! -z "$AUDIOTOOL" ]; then
78 echo "mhbuild-compose-audio/basic: $AUDIOTOOL '%f' && ${AUDIODIR}raw2audio -F < '%f'" >> $TMP
80 echo "mhbuild-compose-audio/basic: trap \"exit 0\" 2 && ${AUDIODIR}record | ${AUDIODIR}raw2audio -F" >> $TMP
82 echo "mhshow-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | ${AUDIODIR}play" >> $TMP
84 PGM="`$SEARCHPROG $SEARCHPATH adpcm_enc`"
85 if [ ! -z "$PGM" ]; then
86 DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
87 if [ ! -z "$AUDIOTOOL" ]; then
88 echo "mhbuild-compose-audio/x-next: $AUDIOTOOL '%f' && ${DIR}adpcm_enc < '%f'" >> $TMP
90 echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc" >> $TMP
92 echo "mhshow-show-audio/x-next: %p${DIR}adpcm_dec | ${AUDIODIR}play" >> $TMP
94 if [ ! -z "$AUDIOTOOL" ]; then
95 echo "mhbuild-compose-audio/x-next: $AUDIOTOOL '%f'" >> $TMP
97 echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record" >> $TMP
99 echo "mhshow-show-audio/x-next: %p${AUDIODIR}play" >> $TMP
102 echo "mhbuild-compose-audio/basic: cat < /dev/audio" >> $TMP
103 echo "mhshow-show-audio/basic: %pcat > /dev/audio" >> $TMP
107 PGM="`$SEARCHPROG $SEARCHPATH mpeg_play`"
108 if [ ! -z "$PGM" ]; then
109 echo "mhshow-show-video/mpeg: %p$PGM '%f'" >> $TMP
112 PGM="`$SEARCHPROG $SEARCHPATH lpr`"
113 if [ ! -z "$PGM" ]; then
114 echo "mhshow-show-application/PostScript: %plpr -Pps" >> $TMP
116 PGM="`$SEARCHPROG $SEARCHPATH lp`"
117 if [ ! -z "$PGM" ]; then
118 echo "mhshow-show-application/PostScript: %plp -dps" >> $TMP
122 PGM="`$SEARCHPROG $SEARCHPATH ivs_replay`"
123 if [ ! -z "$PGM" ]; then
124 echo "mhshow-show-application/x-ivs: %p$PGM -o '%F'" >> $TMP
127 echo "mhshow-suffix-text/html: .html" >> $TMP
129 # I'd like to check if netscape is available and use it preferentially to lynx,
130 # but only once I've added a new %-escape that makes more permanent temp files,
131 # so netscape -remote can be used (without -remote you get a complaint dialog
132 # that another netscape is already running and certain things can't be done).
133 PGM="`$SEARCHPROG $SEARCHPATH lynx`"
134 if [ ! -z "$PGM" ]; then
135 echo "mhshow-show-text/html: %p$PGM '%F'" >> $TMP
138 PGM="`$SEARCHPROG $SEARCHPATH richtext`"
139 if [ ! -z "$PGM" ]; then
140 echo "mhshow-show-text/richtext: %p$PGM -p '%F'" >> $TMP
142 PGM="`$SEARCHPROG $SEARCHPATH rt2raw`"
143 if [ ! -z "$PGM" ]; then
144 echo "mhshow-show-text/richtext: %p$PGM < '%f' | fmt -78 | more" >> $TMP
148 # staroffice to read .doc files
149 PGM="`$SEARCHPROG $SEARCHPATH soffice`"
150 if [ ! -z "$PGM" ]; then
151 echo "mhshow-show-application/msword: %psoffice '%F'" >> $TMP
152 echo "mhshow-suffix-application/msword: .doc" >> $TMP
155 # output a sorted version of the file
160 : not until we get a "safe" postscript environment...
162 PGM="`$SEARCHPROG $SEARCHPATH pageview`"
163 if [ "$DISPLAY" = "unix:0.0" -a ! -z "$PGM" ]; then
164 echo "mhshow-show-application/PostScript: %p$PGM -" >> $TMP
166 PGM="`$SEARCHPROG $SEARCHPATH gs`"
167 if [ ! -z "$PGM" ]; then
168 echo "mhshow-show-application/PostScript: %p$PGM -- '%F'" >> $TMP
169 echo "mhshow-suffix-application/PostScript: .ps" >> $TMP
173 : have to experiment more with this
175 PGM="`$SEARCHPROG $SEARCHPATH ivs_record`"
176 if [ ! -z "$PGM" ]; then
177 echo "mhbuild-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP