3 # mhn.defaults.sh -- create extra profile file for MIME handling
7 # USAGE: mhn.defaults.sh [ search-path [ search-prog ]]
9 # If a search path is passed to the script, we
10 # use that, else we use a default search path.
14 SEARCHPATH="$PATH:/usr/demo/SOUND"
17 # If a search program is passed to the script, we
18 # use that, else we use a default search program.
22 SEARCHPROG="mhn.find.sh"
25 # put output into a temporary file, so we
26 # can sort it before output.
28 trap "rm -f $TMP" 0 1 2 3 13 15
30 echo "mhstore-store-text: %m%P.txt" >> $TMP
31 echo "mhstore-store-text/richtext: %m%P.rt" >> $TMP
32 echo "mhstore-store-video/mpeg: %m%P.mpg" >> $TMP
33 echo "mhstore-store-application/PostScript: %m%P.ps" >> $TMP
35 PGM="`$SEARCHPROG $SEARCHPATH xwud`"
36 if [ ! -z "$PGM" ]; then
37 XWUD="$PGM" X11DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
42 PGM="`$SEARCHPROG $SEARCHPATH pbmtoxwd`"
43 if [ ! -z "$PGM" ]; then
44 PBM="$PGM" PBMDIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
49 PGM="`$SEARCHPROG $SEARCHPATH xv`"
50 if [ ! -z "$PGM" ]; then
51 echo "mhshow-show-image: %p$PGM -geometry =-0+0 '%f'" >> $TMP
52 elif [ ! -z $"PBM" -a ! -z "$XWUD" ]; then
53 echo "mhshow-show-image/gif: %p${PBMDIR}giftoppm | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
54 echo "mhshow-show-image/x-pbm: %p${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
55 echo "mhshow-show-image/x-pgm: %p${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
56 echo "mhshow-show-image/x-ppm: %p${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
57 echo "mhshow-show-image/x-xwd: %p$XWUD -geometry =-0+0" >> $TMP
59 PGM="`$SEARCHPROG $SEARCHPATH djpeg`"
60 if [ ! -z "$PGM" ]; then
61 echo "mhshow-show-image/jpeg: %p$PGM -Pg | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
65 if [ -f "/dev/audioIU" ]; then
66 PGM="`$SEARCHPROG $SEARCHPATH recorder`"
67 if [ ! -z "$PGM" ]; then
68 echo "mhstore-store-audio/basic: %m%P.au" >> $TMP
69 echo "mhbuild-compose-audio/basic: ${AUDIODIR}recorder '%f' -au -pause > /dev/tty" >> $TMP
70 echo "mhshow-show-audio/basic: %p${AUDIODIR}splayer -au" >> $TMP
72 elif [ -f "/dev/audio" ]; then
73 PGM="`$SEARCHPROG $SEARCHPATH raw2audio`"
74 if [ ! -z "$PGM" ]; then
75 AUDIODIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
76 echo "mhstore-store-audio/basic: | ${AUDIODIR}raw2audio -e ulaw -s 8000 -c 1 > %m%P.au" >> $TMP
77 echo "mhstore-store-audio/x-next: %m%P.au" >> $TMP
78 AUDIOTOOL="`$SEARCHPROG $SEARCHPATH audiotool`"
79 if [ ! -z "$AUDIOTOOL" ]; then
80 echo "mhbuild-compose-audio/basic: $AUDIOTOOL '%f' && ${AUDIODIR}raw2audio -F < '%f'" >> $TMP
82 echo "mhbuild-compose-audio/basic: trap \"exit 0\" 2 && ${AUDIODIR}record | ${AUDIODIR}raw2audio -F" >> $TMP
84 echo "mhshow-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | ${AUDIODIR}play" >> $TMP
86 PGM="`$SEARCHPROG $SEARCHPATH adpcm_enc`"
87 if [ ! -z "$PGM" ]; then
88 DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
89 if [ ! -z "$AUDIOTOOL" ]; then
90 echo "mhbuild-compose-audio/x-next: $AUDIOTOOL '%f' && ${DIR}adpcm_enc < '%f'" >> $TMP
92 echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc" >> $TMP
94 echo "mhshow-show-audio/x-next: %p${DIR}adpcm_dec | ${AUDIODIR}play" >> $TMP
96 if [ ! -z "$AUDIOTOOL" ]; then
97 echo "mhbuild-compose-audio/x-next: $AUDIOTOOL '%f'" >> $TMP
99 echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record" >> $TMP
101 echo "mhshow-show-audio/x-next: %p${AUDIODIR}play" >> $TMP
104 echo "mhbuild-compose-audio/basic: cat < /dev/audio" >> $TMP
105 echo "mhshow-show-audio/basic: %pcat > /dev/audio" >> $TMP
109 PGM="`$SEARCHPROG $SEARCHPATH mpeg_play`"
110 if [ ! -z "$PGM" ]; then
111 echo "mhshow-show-video/mpeg: %p$PGM '%f'" >> $TMP
114 PGM="`$SEARCHPROG $SEARCHPATH lpr`"
115 if [ ! -z "$PGM" ]; then
116 echo "mhshow-show-application/PostScript: %plpr -Pps" >> $TMP
118 PGM="`$SEARCHPROG $SEARCHPATH lp`"
119 if [ ! -z "$PGM" ]; then
120 echo "mhshow-show-application/PostScript: %plp -dps" >> $TMP
124 PGM="`$SEARCHPROG $SEARCHPATH ivs_replay`"
125 if [ ! -z "$PGM" ]; then
126 echo "mhshow-show-application/x-ivs: %p$PGM -o '%F'" >> $TMP
129 echo "mhshow-suffix-text/html: .html" >> $TMP
131 # I'd like to check if netscape is available and use it preferentially to lynx,
132 # but only once I've added a new %-escape that makes more permanent temp files,
133 # so netscape -remote can be used (without -remote you get a complaint dialog
134 # that another netscape is already running and certain things can't be done).
135 PGM="`$SEARCHPROG $SEARCHPATH lynx`"
136 if [ ! -z "$PGM" ]; then
137 echo "mhshow-show-text/html: %p$PGM '%F'" >> $TMP
140 PGM="`$SEARCHPROG $SEARCHPATH richtext`"
141 if [ ! -z "$PGM" ]; then
142 echo "mhshow-show-text/richtext: %p$PGM -p '%F'" >> $TMP
144 PGM="`$SEARCHPROG $SEARCHPATH rt2raw`"
145 if [ ! -z "$PGM" ]; then
146 echo "mhshow-show-text/richtext: %p$PGM < '%f' | fmt -78 | more" >> $TMP
150 # staroffice to read .doc files
151 PGM="`$SEARCHPROG $SEARCHPATH soffice`"
152 if [ ! -z "$PGM" ]; then
153 echo "mhshow-show-application/msword: %psoffice '%F'" >> $TMP
154 echo "mhshow-suffix-application/msword: .doc" >> $TMP
157 PGM="`$SEARCHPROG $SEARCHPATH xterm`"
158 if [ ! -z "$PGM" ]; then
159 echo "mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e '%s'" >> $TMP
162 # output a sorted version of the file
167 : not until we get a "safe" postscript environment...
169 PGM="`$SEARCHPROG $SEARCHPATH pageview`"
170 if [ "$DISPLAY" = "unix:0.0" -a ! -z "$PGM" ]; then
171 echo "mhshow-show-application/PostScript: %p$PGM -" >> $TMP
173 PGM="`$SEARCHPROG $SEARCHPATH gs`"
174 if [ ! -z "$PGM" ]; then
175 echo "mhshow-show-application/PostScript: %p$PGM -- '%F'" >> $TMP
176 echo "mhshow-suffix-application/PostScript: .ps" >> $TMP
180 : have to experiment more with this
182 PGM="`$SEARCHPROG $SEARCHPATH ivs_record`"
183 if [ ! -z "$PGM" ]; then
184 echo "mhbuild-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP