10 STAROFFICE_REGEXP
='\.(sxw|sdw|stw|sxc|stc|sxi|sti|sxd|std||sxm||sxg)$'
12 staroffice_console
() {
15 if [ -n "${is_view}" ]; then
19 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
21 soffice2html.pl
"${filename}"
22 elinks
${is_view} content.html
26 get_ooffice_executable
() {
27 which loffice
>/dev
/null
2>&1 && \
37 ps2ascii
"${MC_EXT_FILENAME}"
40 pdftotext
-layout -nopgbrk "${MC_EXT_FILENAME}" -
43 if [ ` echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then
44 staroffice_console
"${MC_EXT_FILENAME}" "view"
46 odt2txt
"${MC_EXT_FILENAME}"
50 which wvHtml
>/dev
/null
2>&1 &&
52 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
53 wvHtml
"${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
54 elinks
-dump "$tmp/page.html"
57 antiword
-t "${MC_EXT_FILENAME}" || \
58 catdoc
-w "${MC_EXT_FILENAME}" || \
59 word2x
-f text
"${MC_EXT_FILENAME}" - || \
60 strings "${MC_EXT_FILENAME}"
63 which xlHtml
>/dev
/null
2>&1 && {
64 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
65 xlhtml
-a "${MC_EXT_FILENAME}" > "$tmp/page.html"
66 elinks
-dump "$tmp/page.html"
69 xls2csv
"${MC_EXT_FILENAME}" || \
70 strings "${MC_EXT_FILENAME}"
73 which dvi2tty
>/dev
/null
2>&1 && \
74 dvi2tty
"${MC_EXT_FILENAME}" || \
75 catdvi
"${MC_EXT_FILENAME}"
78 djvused
-e print-pure-txt
"${MC_EXT_FILENAME}"
81 einfo
-v "${MC_EXT_FILENAME}"
93 if [ -n "$DISPLAY" ]; then
94 (gv
"${MC_EXT_FILENAME}" &)
96 ps2ascii
"${MC_EXT_FILENAME}" |
${PAGER:-more}
100 if [ ! -n "$DISPLAY" ]; then
101 pdftotext
-layout -nopgbrk "${MC_EXT_FILENAME}" - |
${PAGER:-more}
102 elif see
> /dev
/null
2>&1; then
103 (see
"${MC_EXT_FILENAME}" &)
105 (xpdf
"${MC_EXT_FILENAME}" &)
107 #(acroread "${MC_EXT_FILENAME}" &)
108 #(ghostview "${MC_EXT_FILENAME}" &)
111 if [ -n "$DISPLAY" ]; then
112 OOFFICE
=`get_ooffice_executable`
113 (${OOFFICE} "${MC_EXT_FILENAME}" &)
115 if [ `echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then
116 staroffice_console
"${MC_EXT_FILENAME}"
118 odt2txt
"${MC_EXT_FILENAME}" |
${PAGER:-more}
123 (abiword
"${MC_EXT_FILENAME}" &)
126 (gnumeric
"${MC_EXT_FILENAME}" &)
129 if [ -n "$DISPLAY" ]; then
130 (abiword
"${MC_EXT_FILENAME}" >/dev
/null
2>&1 &)
132 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
133 wvHtml
"${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
-1
134 elinks
"$tmp/page.html"
139 if [ -n "$DISPLAY" ]; then
140 (gnumeric
"${MC_EXT_FILENAME}" >/dev
/null
2>&1 &)
142 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
143 xlhtml
-a "${MC_EXT_FILENAME}" > "$tmp/page.html"
144 elinks
"$tmp/page.html"
149 if [ -n "$DISPLAY" ]; then
150 OOFFICE
=`get_ooffice_executable`
151 (${OOFFICE} %f
>/dev
/null
2>&1 &)
153 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
154 ppthtml
%f
> "$tmp/page.html"
155 elinks
"$tmp/page.html"
160 fmclient
-f "${MC_EXT_FILENAME}"
163 if [ -n "$DISPLAY" ]; then
164 (xdvi
"${MC_EXT_FILENAME}" &)
166 dvisvga
"${MC_EXT_FILENAME}" || \
167 dvi2tty
"${MC_EXT_FILENAME}" |
${PAGER:-more}
171 djview
"${MC_EXT_FILENAME}" &
174 cbrpager
"${MC_EXT_FILENAME}" &
177 lucidor
"${MC_EXT_FILENAME}" >/dev
/null
&
186 do_view_action
"${filetype}"
189 xdg-open
"${MC_EXT_FILENAME}" 2>/dev
/null || \
190 do_open_action
"${filetype}"