diff -urN misc/mc.ext.in misc.new/mc.ext.in
old
|
new
|
|
345 | 345 | |
346 | 346 | # CHM |
347 | 347 | regex/\.(chm|CHM)$ |
348 | | Open=which kchmviewer > /dev/null 2>&1 && (kchmviewer %f &) || (xchm %f &) |
| 348 | Open=if [ -n "$DISPLAY" ]; then which kchmviewer > /dev/null 2>&1 && (kchmviewer %f &) || (xchm %f &); else chm_http %f & elinks http://localhost:8080/index.html; kill -INT %%1; fi |
349 | 349 | |
350 | 350 | ### Images ### |
351 | 351 | |
… |
… |
|
391 | 391 | Include=image |
392 | 392 | |
393 | 393 | include/image |
394 | | Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (gqview %f &); fi |
| 394 | Open=if [ -z "$DISPLAY" ]; then zgv %f; else (gqview %f &); fi |
395 | 395 | View=%view{ascii} identify %f |
396 | 396 | #View=%view{ascii} asciiview %f |
397 | 397 | |
398 | | |
399 | 398 | ### Sound files ### |
400 | 399 | |
401 | 400 | regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$ |
402 | | Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi |
| 401 | Open=if [ -z "$DISPLAY" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi |
403 | 402 | |
404 | 403 | regex/\.([mM][oO][dD]|[sS]3[mM]|[xX][mM]|[iI][tT]|[mM][tT][mM]|669|[sS][tT][mM]|[uU][lL][tT]|[fF][aA][rR])$ |
405 | 404 | Open=mikmod %f |
… |
… |
|
409 | 408 | Open=vplay -s 22 %f |
410 | 409 | |
411 | 410 | regex/\.([mM][pP]3)$ |
412 | | Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f >/dev/null 2>&1 &); fi |
| 411 | Open=if [ -z "$DISPLAY" ]; then mpg123 %f; else (xmms %f >/dev/null 2>&1 &); fi |
413 | 412 | View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p' |
414 | 413 | |
415 | 414 | regex/\.([oO][gG][gG|aA|vV|xX])$ |
416 | | Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f >/dev/null 2>&1 &); fi |
| 415 | Open=if [ -z "$DISPLAY" ]; then ogg123 %f; else (xmms %f >/dev/null 2>&1 &); fi |
417 | 416 | View=%view{ascii} ogginfo %s |
418 | 417 | |
419 | 418 | regex/\.([sS][pP][xX]|[fF][lL][aA][cC])$ |
420 | | Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi |
| 419 | Open=if [ -z "$DISPLAY" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi |
421 | 420 | |
422 | 421 | regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$ |
423 | 422 | Open=timidity %f |
… |
… |
|
469 | 467 | Open=(realplay %f >/dev/null 2>&1 &) |
470 | 468 | |
471 | 469 | include/video |
472 | | Open=(mplayer %f >/dev/null 2>&1 &) |
| 470 | Open=if [ -z "$DISPLAY" ]; then mplayer -vo null %f; else (mplayer %f >/dev/null 2>&1 &); fi |
473 | 471 | #Open=(gtv %f >/dev/null 2>&1 &) |
474 | 472 | #Open=(xanim %f >/dev/null 2>&1 &) |
475 | 473 | |
… |
… |
|
478 | 476 | |
479 | 477 | # Postscript |
480 | 478 | type/^PostScript |
481 | | Open=(gv %f &) |
| 479 | Open=if [ -n "$DISPLAY" ]; then (gv %f &); else ps2ascii %f | %var{PAGER:more}; fi |
482 | 480 | View=%view{ascii} ps2ascii %f |
483 | 481 | |
484 | 482 | # PDF |
485 | 483 | type/^PDF |
486 | | Open=(xpdf %f &) |
| 484 | Open=if [ -n "$DISPLAY" ]; then (xpdf %f &); else pdftotext -layout -nopgbrk %f - | %var{PAGER:more}; fi |
487 | 485 | #Open=(acroread %f &) |
488 | 486 | #Open=(ghostview %f &) |
489 | | View=%view{ascii} pdftotext %f - |
| 487 | View=%view{ascii} pdftotext -layout -nopgbrk %f - |
490 | 488 | |
491 | 489 | # The following code very ugly and should not be taken as example. |
492 | 490 | # It should be cleaned up when the new format of mc.ext is developed. |
493 | 491 | |
494 | 492 | # html |
495 | 493 | regex/\.([hH][tT][mM][lL]?)$ |
496 | | Open=(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then (@X11_WWW@ file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null |
497 | | View=%view{ascii} links -dump %f 2>/dev/null || w3m -dump %f 2>/dev/null || lynx -dump -force_html %f |
| 494 | Open=(if test -n "@X11_WWW@" && [ -n "$DISPLAY" ]; then (@X11_WWW@ file://%d/%p &) 1>&2; else elinks %f || links %f || lynx -force_html %f || %var{PAGER:more} %f; fi) 2>/dev/null |
| 495 | View=%view{ascii} elinks -dump %f 2>/dev/null || links -dump %f 2>/dev/null || w3m -dump %f 2>/dev/null || lynx -dump -force_html %f |
498 | 496 | |
499 | 497 | # StarOffice 5.2 |
500 | 498 | shell/.sdw |
501 | 499 | Open=(ooffice %f &) |
502 | 500 | |
| 501 | regex/\.(sxw|SXW)$ |
| 502 | Open=if [ -n "$DISPLAY" ]; then (ooffice %f &); else tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; cd $tmp; /usr/bin/soffice2html.pl %d/%f; /usr/bin/elinks content.html; /bin/rm -rf "$tmp"; fi |
| 503 | View=%view{ascii} tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; cd $tmp; /usr/bin/soffice2html.pl %d/%f; /usr/bin/elinks -dump content.html; rm -rf "$tmp" |
| 504 | |
| 505 | regex/\.(odp|ODP|ods|ODS|odt|ODT)$ |
| 506 | Open=if [ -n "$DISPLAY" ]; then (ooffice %f &); else odt2txt %f | %var{PAGER:more}; fi |
| 507 | |
503 | 508 | # StarOffice 6 and OpenOffice.org formats |
504 | 509 | regex/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$ |
505 | 510 | Open=(ooffice %f &) |
… |
… |
|
511 | 516 | |
512 | 517 | # Microsoft Word Document |
513 | 518 | regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$ |
514 | | Open=(abiword %f >/dev/null 2>&1 &) |
515 | | View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f |
| 519 | Open=if [ -n "$DISPLAY" ]; then (abiword %f >/dev/null 2>&1 &); else tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/wvHtml %f --targetdir="$tmp" page.html -1; /usr/bin/elinks "$tmp/page.html"; /bin/rm -rf "$tmp"; fi |
| 520 | View=%view{ascii} tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/wvHtml %f --targetdir="$tmp" page.html; /usr/bin/elinks -dump "$tmp/page.html"; /bin/rm -rf "$tmp" || antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %fantiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f |
516 | 521 | type/^Microsoft\ Word |
517 | | Open=(abiword %f >/dev/null 2>&1 &) |
518 | | View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f |
| 522 | Open=if [ -n "$DISPLAY" ]; then (abiword %f >/dev/null 2>&1 &); else tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/wvHtml %f --targetdir="$tmp" page.html -1; /usr/bin/elinks "$tmp/page.html"; /bin/rm -rf "$tmp"; fi |
| 523 | View=%view{ascii} tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/wvHtml %f --targetdir="$tmp" page.html; /usr/bin/elinks -dump "$tmp/page.html"; /bin/rm -rf "$tmp" || antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %fantiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f |
519 | 524 | |
520 | 525 | # RTF document |
521 | 526 | regex/\.([rR][tT][fF])$ |
… |
… |
|
523 | 528 | |
524 | 529 | # Microsoft Excel Worksheet |
525 | 530 | regex/\.([xX][lL][sSwW])$ |
526 | | Open=(gnumeric %f >/dev/null 2>&1 &) |
527 | | View=%view{ascii} xls2csv %f || strings %f |
| 531 | Open=if [ -n "$DISPLAY" ]; then (gnumeric %f >/dev/null 2>&1 &); else tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/xlhtml -a %f > "$tmp/page.html"; /usr/bin/elinks "$tmp/page.html"; /bin/rm -rf "$tmp"; fi |
| 532 | View=%view{ascii} tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/xlhtml -a %f > "$tmp/page.html"; /usr/bin/elinks -dump "$tmp/page.html"; /bin/rm -rf "$tmp" || xls2csv %f || strings %f |
528 | 533 | type/^Microsoft\ Excel |
529 | | Open=(gnumeric %f >/dev/null 2>&1 &) |
530 | | View=%view{ascii} xls2csv %f || strings %f |
| 534 | Open=if [ -n "$DISPLAY" ]; then (gnumeric %f >/dev/null 2>&1 &); else tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/xlhtml -a %f > "$tmp/page.html"; /usr/bin/elinks "$tmp/page.html"; /bin/rm -rf "$tmp"; fi |
| 535 | View=%view{ascii} tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/xlhtml -a %f > "$tmp/page.html"; /usr/bin/elinks -dump "$tmp/page.html"; /bin/rm -rf "$tmp" || xls2csv %f || strings %f |
| 536 | |
| 537 | regex/\.(ppt|PPT|pps|PPS)$ |
| 538 | Open=if [ -n "$DISPLAY" ]; then (ooffice %f >/dev/null 2>&1 &); else tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/ppthtml %f > "$tmp/page.html"; /usr/bin/elinks "$tmp/page.html"; /bin/rm -rf "$tmp"; fi |
| 539 | View=%view{ascii} tmp=`/bin/mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`; /usr/bin/ppthtml %f > "$tmp/page.html"; /usr/bin/elinks -dump "$tmp/page.html"; /bin/rm -rf "$tmp" |
531 | 540 | |
532 | 541 | # Use OpenOffice.org to open any MS Office documents |
533 | 542 | type/^Microsoft\ Office\ Document |
… |
… |
|
539 | 548 | |
540 | 549 | # DVI |
541 | 550 | regex/\.([dD][vV][iI])$ |
542 | | Open=if [ x$DISPLAY = x ]; then dvisvga %f; else (xdvi %f &); fi |
| 551 | Open=if [ -z "$DISPLAY" ]; then dvisvga %f || dvi2tty %f | %var{PAGER:more}; else (xdvi %f &); fi |
543 | 552 | View=%view{ascii} dvi2tty %f |
544 | 553 | |
545 | 554 | # TeX |