9 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN
="xdg-open"
11 STAROFFICE_REGEXP
='\.(sxw|sdw|stw|sxc|stc|sxi|sti|sxd|std||sxm||sxg)$'
13 staroffice_console
() {
16 if [ -n "${is_view}" ]; then
20 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
22 soffice2html.pl
"${filename}"
23 elinks
${is_view} content.html
27 get_ooffice_executable
() {
28 if command -v loffice
>/dev
/null
2>&1; then
30 elif command -v ooffice
>/dev
/null
2>&1; then
42 ps2ascii
"${MC_EXT_FILENAME}"
45 pdftotext
-layout -nopgbrk "${MC_EXT_FILENAME}" -
48 if [ ` echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then
49 staroffice_console
"${MC_EXT_FILENAME}" "view"
51 odt2txt
"${MC_EXT_FILENAME}"
55 if command -v wvHtml
>/dev
/null
2>&1; then
56 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
57 wvHtml
"${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
58 elinks
-dump "$tmp/page.html"
60 elif command -v antiword
>/dev
/null
2>&1; then
61 antiword
-t "${MC_EXT_FILENAME}"
62 elif command -v catdoc
>/dev
/null
2>&1; then
63 catdoc
-w "${MC_EXT_FILENAME}"
64 elif command -v word2x
>/dev
/null
2>&1; then
65 word2x
-f text
"${MC_EXT_FILENAME}" -
67 strings "${MC_EXT_FILENAME}"
71 if command -v xlhtml
>/dev
/null
2>&1; then
72 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
73 xlhtml
-a "${MC_EXT_FILENAME}" > "$tmp/page.html"
74 elinks
-dump "$tmp/page.html"
76 elif command -v xls2csv
>/dev
/null
2>&1; then
77 xls2csv
"${MC_EXT_FILENAME}"
79 strings "${MC_EXT_FILENAME}"
83 command -v dvi2tty
>/dev
/null
2>&1 && \
84 dvi2tty
"${MC_EXT_FILENAME}" || \
85 catdvi
"${MC_EXT_FILENAME}"
88 djvused
-e print-pure-txt
"${MC_EXT_FILENAME}"
91 einfo
-v "${MC_EXT_FILENAME}"
101 case "${filetype}" in
103 if [ -n "$DISPLAY" ]; then
104 (gv
"${MC_EXT_FILENAME}" &)
106 ps2ascii
"${MC_EXT_FILENAME}" |
${PAGER:-more}
110 if [ ! -n "$DISPLAY" ]; then
111 pdftotext
-layout -nopgbrk "${MC_EXT_FILENAME}" - |
${PAGER:-more}
112 elif see
> /dev
/null
2>&1; then
113 (see
"${MC_EXT_FILENAME}" &)
115 (xpdf
"${MC_EXT_FILENAME}" &)
117 #(acroread "${MC_EXT_FILENAME}" &)
118 #(ghostview "${MC_EXT_FILENAME}" &)
121 if [ -n "$DISPLAY" ]; then
122 OOFFICE
=`get_ooffice_executable`
123 if [ -n "${OOFFICE}" ]; then
124 (${OOFFICE} "${MC_EXT_FILENAME}" &)
127 if [ `echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then
128 staroffice_console
"${MC_EXT_FILENAME}"
130 odt2txt
"${MC_EXT_FILENAME}" |
${PAGER:-more}
135 (abiword
"${MC_EXT_FILENAME}" &)
138 (gnumeric
"${MC_EXT_FILENAME}" &)
141 if [ -n "$DISPLAY" ]; then
142 OOFFICE
=`get_ooffice_executable`
143 if [ -n "${OOFFICE}" ]; then
144 (${OOFFICE} "${MC_EXT_FILENAME}" &)
146 (abiword
"${MC_EXT_FILENAME}" >/dev
/null
2>&1 &)
149 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
150 wvHtml
"${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
-1
151 elinks
"$tmp/page.html"
156 if [ -n "$DISPLAY" ]; then
157 OOFFICE
=`get_ooffice_executable`
158 if [ -n "${OOFFICE}" ]; then
159 (${OOFFICE} "${MC_EXT_FILENAME}" &)
161 (gnumeric
"${MC_EXT_FILENAME}" >/dev
/null
2>&1 &)
164 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
165 xlhtml
-a "${MC_EXT_FILENAME}" > "$tmp/page.html"
166 elinks
"$tmp/page.html"
171 if [ -n "$DISPLAY" ]; then
172 OOFFICE
=`get_ooffice_executable`
173 if [ -n "${OOFFICE}" ]; then
174 (${OOFFICE} "${MC_EXT_FILENAME}" &)
177 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
178 ppthtml
"${MC_EXT_FILENAME}" > "$tmp/page.html"
179 elinks
"$tmp/page.html"
184 fmclient
-f "${MC_EXT_FILENAME}"
187 if [ -n "$DISPLAY" ]; then
188 (xdvi
"${MC_EXT_FILENAME}" &)
190 dvisvga
"${MC_EXT_FILENAME}" || \
191 dvi2tty
"${MC_EXT_FILENAME}" |
${PAGER:-more}
195 djview
"${MC_EXT_FILENAME}" &
198 cbrpager
"${MC_EXT_FILENAME}" &
201 lucidor
"${MC_EXT_FILENAME}" >/dev
/null
&
210 do_view_action
"${filetype}"
213 ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev
/null
2>&1) || \
214 do_open_action
"${filetype}"