1 | #! /bin/sh |
---|
2 | # |
---|
3 | # mhn.defaults.sh -- create extra profile file for MIME handling |
---|
4 | # |
---|
5 | # $Id: mhn.defaults.sh,v 1.1.1.1 1999-02-07 18:14:19 danw Exp $ |
---|
6 | # |
---|
7 | # USAGE: mhn.defaults.sh [ search-path [ search-prog ]] |
---|
8 | |
---|
9 | # If a search path is passed to the script, we |
---|
10 | # use that, else we use a default search path. |
---|
11 | if [ -n "$1" ]; then |
---|
12 | SEARCHPATH=$1 |
---|
13 | else |
---|
14 | SEARCHPATH="$PATH:/usr/demo/SOUND" |
---|
15 | fi |
---|
16 | |
---|
17 | # If a search program is passed to the script, we |
---|
18 | # use that, else we use a default search program. |
---|
19 | if [ -n "$2" ]; then |
---|
20 | SEARCHPROG=$2 |
---|
21 | else |
---|
22 | SEARCHPROG="mhn.find.sh" |
---|
23 | fi |
---|
24 | |
---|
25 | # put output into a temporary file, so we |
---|
26 | # can sort it before output. |
---|
27 | TMP=/tmp/nmh_temp.$$ |
---|
28 | trap "rm -f $TMP" 0 1 2 3 13 15 |
---|
29 | |
---|
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 |
---|
34 | |
---|
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;}'`"/ |
---|
38 | else |
---|
39 | XWUD= X11DIR= |
---|
40 | fi |
---|
41 | |
---|
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;}'`"/ |
---|
45 | else |
---|
46 | PBM= PBMDIR= |
---|
47 | fi |
---|
48 | |
---|
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 |
---|
58 | |
---|
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 |
---|
62 | fi |
---|
63 | fi |
---|
64 | |
---|
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 |
---|
71 | fi |
---|
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 |
---|
81 | else |
---|
82 | echo "mhbuild-compose-audio/basic: trap \"exit 0\" 2 && ${AUDIODIR}record | ${AUDIODIR}raw2audio -F" >> $TMP |
---|
83 | fi |
---|
84 | echo "mhshow-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | ${AUDIODIR}play" >> $TMP |
---|
85 | |
---|
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 |
---|
91 | else |
---|
92 | echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc" >> $TMP |
---|
93 | fi |
---|
94 | echo "mhshow-show-audio/x-next: %p${DIR}adpcm_dec | ${AUDIODIR}play" >> $TMP |
---|
95 | else |
---|
96 | if [ ! -z "$AUDIOTOOL" ]; then |
---|
97 | echo "mhbuild-compose-audio/x-next: $AUDIOTOOL %f" >> $TMP |
---|
98 | else |
---|
99 | echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record" >> $TMP |
---|
100 | fi |
---|
101 | echo "mhshow-show-audio/x-next: %p${AUDIODIR}play" >> $TMP |
---|
102 | fi |
---|
103 | else |
---|
104 | echo "mhbuild-compose-audio/basic: cat < /dev/audio" >> $TMP |
---|
105 | echo "mhshow-show-audio/basic: %pcat > /dev/audio" >> $TMP |
---|
106 | fi |
---|
107 | fi |
---|
108 | |
---|
109 | PGM="`$SEARCHPROG $SEARCHPATH mpeg_play`" |
---|
110 | if [ ! -z "$PGM" ]; then |
---|
111 | echo "mhshow-show-video/mpeg: %p$PGM '%f'" >> $TMP |
---|
112 | fi |
---|
113 | |
---|
114 | PGM="`$SEARCHPROG $SEARCHPATH lpr`" |
---|
115 | if [ ! -z "$PGM" ]; then |
---|
116 | echo "mhshow-show-application/PostScript: %plpr -Pps" >> $TMP |
---|
117 | else |
---|
118 | PGM="`$SEARCHPROG $SEARCHPATH lp`" |
---|
119 | if [ ! -z "$PGM" ]; then |
---|
120 | echo "mhshow-show-application/PostScript: %plp -dps" >> $TMP |
---|
121 | fi |
---|
122 | fi |
---|
123 | |
---|
124 | PGM="`$SEARCHPROG $SEARCHPATH ivs_replay`" |
---|
125 | if [ ! -z "$PGM" ]; then |
---|
126 | echo "mhshow-show-application/x-ivs: %p$PGM -o '%F'" >> $TMP |
---|
127 | fi |
---|
128 | |
---|
129 | PGM="`$SEARCHPROG $SEARCHPATH richtext`" |
---|
130 | if [ ! -z "$PGM" ]; then |
---|
131 | echo "mhshow-show-text/richtext: %p$PGM -p '%F'" >> $TMP |
---|
132 | else |
---|
133 | PGM="`$SEARCHPROG $SEARCHPATH rt2raw`" |
---|
134 | if [ ! -z "$PGM" ]; then |
---|
135 | echo "mhshow-show-text/richtext: %p$PGM < '%f' | fmt -78 | more" >> $TMP |
---|
136 | fi |
---|
137 | fi |
---|
138 | |
---|
139 | PGM="`$SEARCHPROG $SEARCHPATH xterm`" |
---|
140 | if [ ! -z "$PGM" ]; then |
---|
141 | echo "mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s" >> $TMP |
---|
142 | fi |
---|
143 | |
---|
144 | # output a sorted version of the file |
---|
145 | sort < $TMP |
---|
146 | |
---|
147 | exit 0 |
---|
148 | |
---|
149 | : not until we get a "safe" postscript environment... |
---|
150 | |
---|
151 | PGM="`$SEARCHPROG $SEARCHPATH pageview`" |
---|
152 | if [ "$DISPLAY" = "unix:0.0" -a ! -z "$PGM" ]; then |
---|
153 | echo "mhshow-show-application/PostScript: %p$PGM -" >> $TMP |
---|
154 | else |
---|
155 | PGM="`$SEARCHPROG $SEARCHPATH gs`" |
---|
156 | if [ ! -z "$PGM" ]; then |
---|
157 | echo "mhshow-show-application/PostScript: %p$PGM -- '%F'" >> $TMP |
---|
158 | fi |
---|
159 | fi |
---|
160 | |
---|
161 | : have to experiment more with this |
---|
162 | |
---|
163 | PGM="`$SEARCHPROG $SEARCHPATH ivs_record`" |
---|
164 | if [ ! -z "$PGM" ]; then |
---|
165 | echo "mhbuild-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP |
---|
166 | fi |
---|