source: trunk/third/nmh/etc/mhn.defaults.sh @ 12455

Revision 12455, 5.6 KB checked in by danw, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12454, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
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.
11if [ -n "$1" ]; then
12    SEARCHPATH=$1
13else
14    SEARCHPATH="$PATH:/usr/demo/SOUND"
15fi
16
17# If a search program is passed to the script, we
18# use that, else we use a default search program.
19if [ -n "$2" ]; then
20    SEARCHPROG=$2
21else
22    SEARCHPROG="mhn.find.sh"
23fi
24
25# put output into a temporary file, so we
26# can sort it before output.
27TMP=/tmp/nmh_temp.$$
28trap "rm -f $TMP" 0 1 2 3 13 15
29
30echo "mhstore-store-text: %m%P.txt" >> $TMP
31echo "mhstore-store-text/richtext: %m%P.rt" >> $TMP
32echo "mhstore-store-video/mpeg: %m%P.mpg" >> $TMP
33echo "mhstore-store-application/PostScript: %m%P.ps" >> $TMP
34
35PGM="`$SEARCHPROG $SEARCHPATH xwud`"
36if [ ! -z "$PGM" ]; then
37    XWUD="$PGM" X11DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
38else
39    XWUD= X11DIR=
40fi
41
42PGM="`$SEARCHPROG $SEARCHPATH pbmtoxwd`"
43if [ ! -z "$PGM" ]; then
44    PBM="$PGM" PBMDIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
45else
46    PBM= PBMDIR=
47fi
48
49PGM="`$SEARCHPROG $SEARCHPATH xv`"
50if [ ! -z "$PGM" ]; then
51    echo "mhshow-show-image: %p$PGM -geometry =-0+0 '%f'" >> $TMP
52elif [ ! -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
63fi
64
65if [ -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
72elif [ -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
107fi
108
109PGM="`$SEARCHPROG $SEARCHPATH mpeg_play`"
110if [ ! -z "$PGM" ]; then
111        echo "mhshow-show-video/mpeg: %p$PGM '%f'" >> $TMP
112fi
113
114PGM="`$SEARCHPROG $SEARCHPATH lpr`"
115if [ ! -z "$PGM" ]; then
116        echo "mhshow-show-application/PostScript: %plpr -Pps" >> $TMP
117else
118    PGM="`$SEARCHPROG $SEARCHPATH lp`"
119    if [ ! -z "$PGM" ]; then   
120        echo "mhshow-show-application/PostScript: %plp -dps" >> $TMP
121    fi
122fi
123
124PGM="`$SEARCHPROG $SEARCHPATH ivs_replay`"
125if [ ! -z "$PGM" ]; then
126        echo "mhshow-show-application/x-ivs: %p$PGM -o '%F'" >> $TMP
127fi
128
129PGM="`$SEARCHPROG $SEARCHPATH richtext`"
130if [ ! -z "$PGM" ]; then
131        echo "mhshow-show-text/richtext: %p$PGM -p '%F'" >> $TMP
132else
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
137fi
138
139PGM="`$SEARCHPROG $SEARCHPATH xterm`"
140if [ ! -z "$PGM" ]; then
141        echo "mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s" >> $TMP
142fi
143
144# output a sorted version of the file
145sort < $TMP
146
147exit 0
148
149: not until we get a "safe" postscript environment...
150
151PGM="`$SEARCHPROG $SEARCHPATH pageview`"
152if [ "$DISPLAY" = "unix:0.0" -a ! -z "$PGM" ]; then
153    echo "mhshow-show-application/PostScript: %p$PGM -" >> $TMP
154else
155    PGM="`$SEARCHPROG $SEARCHPATH gs`"
156    if [ ! -z "$PGM" ]; then
157        echo "mhshow-show-application/PostScript: %p$PGM -- '%F'" >> $TMP
158    fi
159fi
160
161: have to experiment more with this
162
163PGM="`$SEARCHPROG $SEARCHPATH ivs_record`"
164if [ ! -z "$PGM" ]; then
165        echo "mhbuild-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP
166fi
Note: See TracBrowser for help on using the repository browser.