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 which loffice
>/dev
/null
2>&1 && \
38 ps2ascii
"${MC_EXT_FILENAME}"
41 pdftotext
-layout -nopgbrk "${MC_EXT_FILENAME}" -
44 if [ ` echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then
45 staroffice_console
"${MC_EXT_FILENAME}" "view"
47 odt2txt
"${MC_EXT_FILENAME}"
51 which wvHtml
>/dev
/null
2>&1 &&
53 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
54 wvHtml
"${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
55 elinks
-dump "$tmp/page.html"
58 antiword
-t "${MC_EXT_FILENAME}" || \
59 catdoc
-w "${MC_EXT_FILENAME}" || \
60 word2x
-f text
"${MC_EXT_FILENAME}" - || \
61 strings "${MC_EXT_FILENAME}"
64 which xlHtml
>/dev
/null
2>&1 && {
65 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
66 xlhtml
-a "${MC_EXT_FILENAME}" > "$tmp/page.html"
67 elinks
-dump "$tmp/page.html"
70 xls2csv
"${MC_EXT_FILENAME}" || \
71 strings "${MC_EXT_FILENAME}"
74 which dvi2tty
>/dev
/null
2>&1 && \
75 dvi2tty
"${MC_EXT_FILENAME}" || \
76 catdvi
"${MC_EXT_FILENAME}"
79 djvused
-e print-pure-txt
"${MC_EXT_FILENAME}"
82 einfo
-v "${MC_EXT_FILENAME}"
94 if [ -n "$DISPLAY" ]; then
95 (gv
"${MC_EXT_FILENAME}" &)
97 ps2ascii
"${MC_EXT_FILENAME}" |
${PAGER:-more}
101 if [ ! -n "$DISPLAY" ]; then
102 pdftotext
-layout -nopgbrk "${MC_EXT_FILENAME}" - |
${PAGER:-more}
103 elif see
> /dev
/null
2>&1; then
104 (see
"${MC_EXT_FILENAME}" &)
106 (xpdf
"${MC_EXT_FILENAME}" &)
108 #(acroread "${MC_EXT_FILENAME}" &)
109 #(ghostview "${MC_EXT_FILENAME}" &)
112 if [ -n "$DISPLAY" ]; then
113 OOFFICE
=`get_ooffice_executable`
114 (${OOFFICE} "${MC_EXT_FILENAME}" &)
116 if [ `echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then
117 staroffice_console
"${MC_EXT_FILENAME}"
119 odt2txt
"${MC_EXT_FILENAME}" |
${PAGER:-more}
124 (abiword
"${MC_EXT_FILENAME}" &)
127 (gnumeric
"${MC_EXT_FILENAME}" &)
130 if [ -n "$DISPLAY" ]; then
131 (abiword
"${MC_EXT_FILENAME}" >/dev
/null
2>&1 &)
133 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
134 wvHtml
"${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
-1
135 elinks
"$tmp/page.html"
140 if [ -n "$DISPLAY" ]; then
141 (gnumeric
"${MC_EXT_FILENAME}" >/dev
/null
2>&1 &)
143 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
144 xlhtml
-a "${MC_EXT_FILENAME}" > "$tmp/page.html"
145 elinks
"$tmp/page.html"
150 if [ -n "$DISPLAY" ]; then
151 OOFFICE
=`get_ooffice_executable`
152 (${OOFFICE} %f
>/dev
/null
2>&1 &)
154 tmp
=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
155 ppthtml
%f
> "$tmp/page.html"
156 elinks
"$tmp/page.html"
161 fmclient
-f "${MC_EXT_FILENAME}"
164 if [ -n "$DISPLAY" ]; then
165 (xdvi
"${MC_EXT_FILENAME}" &)
167 dvisvga
"${MC_EXT_FILENAME}" || \
168 dvi2tty
"${MC_EXT_FILENAME}" |
${PAGER:-more}
172 djview
"${MC_EXT_FILENAME}" &
175 cbrpager
"${MC_EXT_FILENAME}" &
178 lucidor
"${MC_EXT_FILENAME}" >/dev
/null
&
187 do_view_action
"${filetype}"
190 "${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" 2>/dev
/null || \
191 do_open_action
"${filetype}"