3 XCOMM dtopen - provide an interface for some useful applications.
5 XCOMM #############################################################
6 XCOMM #set -x # uncomment for debugging
7 XCOMM ###############################################################
10 DTOPEN="dtopen" # Identity crisis
11 APPNAME="$(basename $0)" # the app to locate/run
13 XCOMM apps to look for, given an action (based on APPNAME - see MAIN)
16 if [ -z "$DTOPEN_VIMAGE" ]
18 VIMAGE="xv display gimp"
20 VIMAGE="$DTOPEN_VIMAGE"
24 if [ -z "$DTOPEN_VVIDEO" ]
28 VVIDEO="$DTOPEN_VVIDEO"
31 XCOMM postscript viewing
32 if [ -z "$DTOPEN_VPS" ]
40 if [ -z "$DTOPEN_VPDF" ]
47 XCOMM ##############################################################
48 XCOMM ## Utility Functions
50 XCOMM ## Find the path of a program
54 # - returns full path, or ""
61 XCOMM ## Show an error message
64 # ErrorMsg "Title "Message" ["OK"]
65 # use dterror.ds to display it...
68 then # default to 'OK'
74 CDE_INSTALLATION_TOP/bin/dterror.ds "$2" "$1" "$OKM"
79 XCOMM ## do a simple command
82 # DoSimpleCmd "commands" args
91 thecmd="$(FindProg $i)"
102 then # couldn't find a viewer
103 ErrorMsg "Helper not found" \
104 "${DTOPEN}: Could not find any of the following\ncommands for this file type:\n\n$cmds"
111 XCOMM ##################################################################
114 XCOMM # We'll just look at our args and decide what to do...
116 XCOMM # Commands we'll recognize
118 COMMANDS="dtopen_image dtopen_pdf dtopen_ps dtopen_video"
122 DoSimpleCmd "$VIMAGE" $*
125 DoSimpleCmd "$VPDF" $*
128 DoSimpleCmd "$VPS" $*
131 DoSimpleCmd "$VVIDEO" $*
135 ErrorMsg "${DTOPEN}: Unknown Helper Application" \
136 "\"$APPNAME\" is not a recognized Helper Application. \nKnown Helper Applications are:\n\n$COMMANDS"