Use xdg-open by default in mc.ext.in if present to open files,
fallback on current scheme otherwise. Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Этот коммит содержится в:
родитель
d14f481785
Коммит
ec7aafef83
@ -481,6 +481,10 @@ AC_SUBST(LIBS)
|
||||
dnl Libraries used only when building the mc binary
|
||||
AC_SUBST(MCLIBS)
|
||||
|
||||
|
||||
EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
|
||||
AC_SUBST(EXTHELPERSDIR)
|
||||
|
||||
MAN_DATE="$(LC_ALL=C date "+%B %Y")"
|
||||
AC_SUBST(MAN_DATE)
|
||||
|
||||
@ -514,6 +518,10 @@ contrib/dist/prototype
|
||||
|
||||
misc/Makefile
|
||||
misc/skins/Makefile
|
||||
misc/ext.d/Makefile
|
||||
misc/ext.d/doc.sh
|
||||
misc/ext.d/text.sh
|
||||
misc/ext.d/web.sh
|
||||
misc/macros.d/Makefile
|
||||
misc/mc.ext
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
## Process this file with automake to create Makefile.in.
|
||||
|
||||
SUBDIRS = macros.d skins syntax
|
||||
SUBDIRS = ext.d macros.d skins syntax
|
||||
|
||||
LIBFILES_OUT = mc.ext
|
||||
|
||||
|
28
misc/ext.d/Makefile.am
Обычный файл
28
misc/ext.d/Makefile.am
Обычный файл
@ -0,0 +1,28 @@
|
||||
extdir = $(EXTHELPERSDIR)
|
||||
|
||||
SCRIPTS_IN = \
|
||||
doc.sh.in \
|
||||
text.sh.in \
|
||||
web.sh.in
|
||||
|
||||
SCRIPTS_OUT = \
|
||||
doc.sh \
|
||||
text.sh \
|
||||
web.sh
|
||||
|
||||
SCRIPTS_UNTOUCHED = \
|
||||
archive.sh \
|
||||
image.sh \
|
||||
misc.sh \
|
||||
package.sh \
|
||||
sound.sh \
|
||||
video.sh
|
||||
|
||||
ext_SCRIPTS = \
|
||||
$(SCRIPTS_UNTOUCHED) \
|
||||
$(SCRIPTS_OUT)
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(SCRIPTS_UNTOUCHED) \
|
||||
$(SCRIPTS_IN)
|
||||
|
143
misc/ext.d/archive.sh
Обычный файл
143
misc/ext.d/archive.sh
Обычный файл
@ -0,0 +1,143 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
# $3 - pager
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
pager=$3
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
gz)
|
||||
gzip -dc "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
bz2)
|
||||
bzip2 -dc "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
bzip)
|
||||
bzip2 -dc "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
lzma)
|
||||
lzma -dc "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
xz)
|
||||
xz -dc "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
tar)
|
||||
tar tvvf - < "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
tar.gz|tar.qpr)
|
||||
gzip -dc "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
tar tvvf -
|
||||
;;
|
||||
tar.bzip)
|
||||
bzip -dc "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
tar tvvf -
|
||||
;;
|
||||
tar.bzip2)
|
||||
bzip2 -dc "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
tar tvvf -
|
||||
;;
|
||||
tar.lzma)
|
||||
lzma -dc "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
tar tvvf -
|
||||
;;
|
||||
tar.xz)
|
||||
xz -dc "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
tar tvvf -
|
||||
;;
|
||||
tar.F)
|
||||
freeze -dc "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
tar tvvf -
|
||||
;;
|
||||
|
||||
lha)
|
||||
lha l "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
arj)
|
||||
unarj l "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
cab)
|
||||
cabextract -l "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
ha)
|
||||
ha lf "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
rar)
|
||||
rar v -c- "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
unrar v -c- "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
alz)
|
||||
unalz -l "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
cpio.z|cpio.gz)
|
||||
gzip -dc "${MC_EXT_FILENAME}" | \
|
||||
cpio -itv 2>/dev/null
|
||||
;;
|
||||
cpio.xz)
|
||||
xz -dc "${MC_EXT_FILENAME}" | \
|
||||
cpio -itv 2>/dev/null
|
||||
;;
|
||||
cpio)
|
||||
cpio -itv < "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
7z)
|
||||
7za l "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
ace)
|
||||
unace l "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
arc)
|
||||
arc l "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
zip)
|
||||
unzip -v "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
zoo)
|
||||
zoo l "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
pager=$2
|
||||
|
||||
case "${filetype}" in
|
||||
bzip2)
|
||||
bzip2 -dc "${MC_EXT_FILENAME}" | ${pager}
|
||||
;;
|
||||
bzip)
|
||||
bzip -dc "${MC_EXT_FILENAME}" | ${pager}
|
||||
;;
|
||||
gz)
|
||||
gz -dc "${MC_EXT_FILENAME}" | ${pager}
|
||||
;;
|
||||
lzma)
|
||||
lzma -dc "${MC_EXT_FILENAME}" | ${pager}
|
||||
;;
|
||||
xz)
|
||||
xz -dc "${MC_EXT_FILENAME}" | ${pager}
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}" "${pager}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
96
misc/ext.d/doc.sh.in
Обычный файл
96
misc/ext.d/doc.sh.in
Обычный файл
@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
ps)
|
||||
ps2ascii "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
pdf)
|
||||
pdftotext "${MC_EXT_FILENAME}" -
|
||||
;;
|
||||
odt)
|
||||
odt2txt "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
msdoc)
|
||||
antiword -t "${MC_EXT_FILENAME}" || \
|
||||
catdoc -w "${MC_EXT_FILENAME}" || \
|
||||
word2x -f text "${MC_EXT_FILENAME}" - || \
|
||||
strings "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
msxls)
|
||||
xls2csv "${MC_EXT_FILENAME}" || \
|
||||
strings "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
dvi)
|
||||
dvi2tty "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
djvu)
|
||||
djvused -e print-pure-txt "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
ps)
|
||||
(gv "${MC_EXT_FILENAME}" &)
|
||||
;;
|
||||
pdf)
|
||||
(xpdf "${MC_EXT_FILENAME}" &)
|
||||
#(acroread "${MC_EXT_FILENAME}" &)
|
||||
#(ghostview "${MC_EXT_FILENAME}" &)
|
||||
;;
|
||||
ooffice)
|
||||
(ooffice "${MC_EXT_FILENAME}" &)
|
||||
;;
|
||||
abw)
|
||||
(abiword "${MC_EXT_FILENAME}" &)
|
||||
;;
|
||||
msdoc)
|
||||
(abiword "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
;;
|
||||
msxls)
|
||||
(gnumeric "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
;;
|
||||
framemaker)
|
||||
fmclient -f "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
dvi)
|
||||
if [ x$DISPLAY = x ]; then
|
||||
dvisvga "${MC_EXT_FILENAME}"
|
||||
else
|
||||
(xdvi "${MC_EXT_FILENAME}" &)
|
||||
fi
|
||||
;;
|
||||
djvu)
|
||||
djview "${MC_EXT_FILENAME}" &
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
55
misc/ext.d/image.sh
Обычный файл
55
misc/ext.d/image.sh
Обычный файл
@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
jpeg)
|
||||
identify "${MC_EXT_FILENAME}"; test -x /usr/bin/exif && echo && exif "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
xpm)
|
||||
sxpm "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
identify "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
xbm)
|
||||
bitmap "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
xcf)
|
||||
(gimp "${MC_EXT_FILENAME}" &)
|
||||
;;
|
||||
*)
|
||||
if [ "$DISPLAY" = "" ]; then
|
||||
zgv "${MC_EXT_FILENAME}"
|
||||
else
|
||||
(gqview "${MC_EXT_FILENAME}" &)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
82
misc/ext.d/misc.sh
Обычный файл
82
misc/ext.d/misc.sh
Обычный файл
@ -0,0 +1,82 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
filename=$2
|
||||
|
||||
case "${filetype}" in
|
||||
iso9660)
|
||||
isoinfo -l -i "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
cat)
|
||||
/bin/cat "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
ar)
|
||||
file "${MC_EXT_FILENAME}" && nm -C "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
so)
|
||||
file "${MC_EXT_FILENAME}" && nm -C -D "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
elf)
|
||||
file "${MC_EXT_FILENAME}" && nm -C "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
dbf)
|
||||
dbview -b "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
mo)
|
||||
msgunfmt "${MC_EXT_FILENAME}" || \
|
||||
cat "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
lyx)
|
||||
lyxcat "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
torrent)
|
||||
ctorrent -x "${MC_EXT_FILENAME}" 2>/dev/null
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
imakefile)
|
||||
xmkmf -a
|
||||
;;
|
||||
dbf)
|
||||
dbview "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
glade)
|
||||
if glade-3 --version >/dev/null 2>&1; then
|
||||
(glade-3 "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
else
|
||||
(glade-2 "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
fi
|
||||
;;
|
||||
lyx)
|
||||
lyx "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
59
misc/ext.d/package.sh
Обычный файл
59
misc/ext.d/package.sh
Обычный файл
@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
filename=$2
|
||||
|
||||
case "${filetype}" in
|
||||
trpm)
|
||||
rpm -qivl --scripts `basename "${MC_EXT_BASENAME}" .trpm`
|
||||
;;
|
||||
src.rpm|rpm)
|
||||
if rpm --nosignature --version >/dev/null 2>&1; then
|
||||
RPM="rpm --nosignature"
|
||||
else
|
||||
RPM="rpm"
|
||||
fi
|
||||
$RPM -qivlp --scripts "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
deb)
|
||||
dpkg-deb -I "${filename}" && echo && dpkg-deb -c "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
debd)
|
||||
dpkg -s `echo "${MC_EXT_BASENAME}" | sed 's/\([0-9a-z.-]*\).*/\1/'`
|
||||
;;
|
||||
deba)
|
||||
apt-cache show `echo "${MC_EXT_BASENAME}" | sed 's/\([0-9a-z.-]*\).*/\1/'`
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
89
misc/ext.d/sound.sh
Обычный файл
89
misc/ext.d/sound.sh
Обычный файл
@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
mp3)
|
||||
mpg123 -vtn1 "${MC_EXT_FILENAME}" 2>&1 | \
|
||||
sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
|
||||
;;
|
||||
ogg)
|
||||
ogginfo "${MC_EXT_SELECTED}"
|
||||
;;
|
||||
wma)
|
||||
mplayer -quiet -slave -frames 0 -vo null -ao null -identify "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
tail +13 || file "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
common)
|
||||
if [ "$DISPLAY" = "" ]; then
|
||||
play "${MC_EXT_FILENAME}"
|
||||
else
|
||||
(xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
fi
|
||||
;;
|
||||
mod)
|
||||
mikmod "${MC_EXT_FILENAME}"
|
||||
#tracker "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
wav22)
|
||||
vplay -s 22 "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
mp3)
|
||||
if [ "$DISPLAY" = "" ]; then
|
||||
mpg123 "${MC_EXT_FILENAME}"
|
||||
else
|
||||
(xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
fi
|
||||
;;
|
||||
ogg)
|
||||
if [ "$DISPLAY" = "" ]; then
|
||||
ogg123 "${MC_EXT_FILENAME}"
|
||||
else
|
||||
(xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
fi
|
||||
;;
|
||||
midi)
|
||||
timidity "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
wma)
|
||||
mplayer -vo null "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
playlist)
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
mplayer -vo null -playlist "${MC_EXT_FILENAME}"
|
||||
else
|
||||
(xmms -p "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
133
misc/ext.d/text.sh.in
Обычный файл
133
misc/ext.d/text.sh.in
Обычный файл
@ -0,0 +1,133 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of archive
|
||||
# $3 - pager
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
pager=$3
|
||||
|
||||
get_unpacker() {
|
||||
filetype=$1
|
||||
case "${filetype}" in
|
||||
man.gz)
|
||||
unpacker="gzip -dc"
|
||||
;;
|
||||
man.bz)
|
||||
unpacker="bzip -dc"
|
||||
;;
|
||||
man.bz2)
|
||||
unpacker="bzip2 -dc"
|
||||
;;
|
||||
man.lzma)
|
||||
unpacker="lzma -dc"
|
||||
;;
|
||||
man.xz)
|
||||
unpacker="xz -dc"
|
||||
;;
|
||||
esac
|
||||
echo ${unpacker}
|
||||
}
|
||||
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
pager=$2
|
||||
|
||||
unpacker=`get_unpacker ${filetype}`
|
||||
|
||||
case "${filetype}" in
|
||||
man)
|
||||
case "${MC_EXT_CURRENTDIR}"/"${MC_EXT_FILENAME}" in
|
||||
*/log/*|*/logs/*)
|
||||
cat "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
{ zsoelim "${MC_EXT_FILENAME}" 2>/dev/null || cat "${MC_EXT_FILENAME}"; } | nroff @MAN_FLAGS@ @MANDOC@
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
pod)
|
||||
pod2man "${MC_EXT_FILENAME}" | nroff @MAN_FLAGS@ @MANDOC@
|
||||
;;
|
||||
nroff.me)
|
||||
nroff @MAN_FLAGS@ -me "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
nroff.ms)
|
||||
nroff @MAN_FLAGS@ -ms "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
man.gz|man.bz|man.bz2|man.lzma|man.xz)
|
||||
case "${MC_EXT_CURRENTDIR}"/"${MC_EXT_FILENAME}" in
|
||||
*/log/*|*/logs/*)
|
||||
${unpacker} %f
|
||||
;;
|
||||
*)
|
||||
${unpacker} ${filename} | nroff @MAN_FLAGS@ @MANDOC@
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
pager=$2
|
||||
|
||||
unpacker=`get_unpacker ${filetype}`
|
||||
|
||||
case "${filetype}" in
|
||||
info)
|
||||
info -f "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
man)
|
||||
case "${MC_EXT_CURRENTDIR}"/"${MC_EXT_FILENAME}" in
|
||||
*/log/*|*/logs/*)
|
||||
cat "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
{ zsoelim "${MC_EXT_FILENAME}" 2>/dev/null || cat "${MC_EXT_FILENAME}"; } | \
|
||||
nroff @MAN_FLAGS@ @MANDOC@
|
||||
;;
|
||||
esac | ${pager}
|
||||
;;
|
||||
pod)
|
||||
pod2man "${MC_EXT_FILENAME}" | nroff @MAN_FLAGS@ @MANDOC@ | ${pager}
|
||||
;;
|
||||
nroff.me)
|
||||
nroff @MAN_FLAGS@ -me "${MC_EXT_FILENAME}" | ${pager}
|
||||
;;
|
||||
nroff.ms)
|
||||
nroff @MAN_FLAGS@ -ms "${MC_EXT_FILENAME}" | ${pager}
|
||||
;;
|
||||
man.gz|man.bz|man.bz2|man.lzma|man.xz)
|
||||
case "${MC_EXT_CURRENTDIR}"/"${MC_EXT_FILENAME}" in
|
||||
*/log/*|*/logs/*)
|
||||
${unpacker} "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
${unpacker} "${MC_EXT_FILENAME}" | nroff @MAN_FLAGS@ @MANDOC@
|
||||
;;
|
||||
esac | ${pager}
|
||||
;;
|
||||
chm)
|
||||
which kchmviewer > /dev/null 2>&1 && (kchmviewer "${MC_EXT_FILENAME}" &) || (xchm "${MC_EXT_FILENAME}" &)
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}" "${pager}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}" "${pager}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
44
misc/ext.d/video.sh
Обычный файл
44
misc/ext.d/video.sh
Обычный файл
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
ram)
|
||||
(realplay "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
;;
|
||||
*)
|
||||
(mplayer "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
#(gtv "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
#(xanim "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
53
misc/ext.d/web.sh.in
Обычный файл
53
misc/ext.d/web.sh.in
Обычный файл
@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - action
|
||||
# $2 - type of file
|
||||
|
||||
action=$1
|
||||
filetype=$2
|
||||
|
||||
|
||||
do_view_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
html)
|
||||
links -dump "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
w3m -dump "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
lynx -dump -force_html "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
do_open_action() {
|
||||
filetype=$1
|
||||
|
||||
case "${filetype}" in
|
||||
html)
|
||||
(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then
|
||||
(@X11_WWW@ file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" &) 1>&2
|
||||
else
|
||||
links "${MC_EXT_FILENAME}" || \
|
||||
lynx -force_html "${MC_EXT_FILENAME}" || \
|
||||
${PAGER:-more} "${MC_EXT_FILENAME}"
|
||||
fi) 2>/dev/null
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${action}" in
|
||||
view)
|
||||
do_view_action "${filetype}"
|
||||
;;
|
||||
open)
|
||||
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
|
||||
do_open_action "${filetype}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
329
misc/mc.ext.in
329
misc/mc.ext.in
@ -125,148 +125,150 @@ regex/^\[git\]
|
||||
# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk
|
||||
regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk|\.gem$
|
||||
Open=%cd %p/utar://
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.gz
|
||||
|
||||
regex/\.tar\.bz$
|
||||
# Open=%cd %p/utar://
|
||||
View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.bzip
|
||||
|
||||
regex/\.t(ar\.bz2|bz2?|b2)$
|
||||
Open=%cd %p/utar://
|
||||
View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.bzip2
|
||||
|
||||
# .tar.lzma, .tlz
|
||||
regex/\.t(ar\.lzma|lz)$
|
||||
Open=%cd %p/utar://
|
||||
View=%view{ascii} lzma -dc %f 2>/dev/null | tar tvvf -
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.lzma
|
||||
|
||||
# .tar.xz, .txz
|
||||
regex/\.t(ar\.xz|xz)$
|
||||
Open=%cd %p/utar://
|
||||
View=%view{ascii} xz -dc %f 2>/dev/null | tar tvvf -
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.xz
|
||||
|
||||
# .tar.F - used in QNX
|
||||
regex/\.tar\.F$
|
||||
# Open=%cd %p/utar://
|
||||
View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.F
|
||||
|
||||
# .qpr/.qpk - QNX Neutrino package installer files
|
||||
regex/\.(qp[rk])$
|
||||
Open=%cd %p/utar://
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.qpr
|
||||
|
||||
# tar
|
||||
regex/\.(tar|TAR)$
|
||||
Open=%cd %p/utar://
|
||||
View=%view{ascii} tar tvvf - < %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar
|
||||
|
||||
# lha
|
||||
type/^LHa\ .*archive
|
||||
Open=%cd %p/ulha://
|
||||
View=%view{ascii} lha l %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view lha
|
||||
|
||||
# arj
|
||||
regex/\.a(rj|[0-9][0-9])$
|
||||
Open=%cd %p/uarj://
|
||||
View=%view{ascii} unarj l %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view arj
|
||||
|
||||
# cab
|
||||
regex/\.([cC][aA][bB])$
|
||||
Open=%cd %p/ucab://
|
||||
View=%view{ascii} cabextract -l %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view cab
|
||||
|
||||
# ha
|
||||
regex/\.([Hh][Aa])$
|
||||
Open=%cd %p/uha://
|
||||
View=%view{ascii} ha lf %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view ha
|
||||
|
||||
# rar
|
||||
regex/\.[rR]([aA][rR]|[0-9][0-9])$
|
||||
Open=%cd %p/urar://
|
||||
View=%view{ascii} rar v -c- %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view rar
|
||||
|
||||
# ALZip
|
||||
regex/\.(alz|ALZ)$
|
||||
Open=%cd %p/ualz://
|
||||
View=%view{ascii} unalz -l %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view alz
|
||||
|
||||
# cpio
|
||||
shell/.cpio.Z
|
||||
Open=%cd %p/ucpio://
|
||||
View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view cpio.z
|
||||
|
||||
shell/.cpio.xz
|
||||
Open=%cd %p/ucpio://
|
||||
View=%view{ascii} xz -dc %f | cpio -itv 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view cpio.xz
|
||||
|
||||
shell/.cpio.gz
|
||||
Open=%cd %p/ucpio://
|
||||
View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view cpio.gz
|
||||
|
||||
shell/.cpio
|
||||
Open=%cd %p/ucpio://
|
||||
View=%view{ascii} cpio -itv < %f 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view cpio
|
||||
|
||||
# 7zip archives (they are not man pages)
|
||||
regex/\.(7z|7Z)$
|
||||
Open=%cd %p/u7z://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view 7z
|
||||
|
||||
# patch
|
||||
regex/\.(diff|patch)(\.bz2)$
|
||||
Open=%cd %p/patchfs://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view bz2
|
||||
|
||||
regex/\.(diff|patch)(\.(gz|Z))$
|
||||
Open=%cd %p/patchfs://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view gz
|
||||
|
||||
# ls-lR
|
||||
regex/(^|\.)ls-?lR(\.gz|Z|bz2)$
|
||||
Open=%cd %p/lslR://
|
||||
|
||||
# patch
|
||||
regex/\.(diff|patch)(\.bz2)$
|
||||
Open=%cd %p/patchfs://
|
||||
View=%view{ascii} bzip2 -dc %f 2>/dev/null
|
||||
# trpm
|
||||
regex/\.trpm$
|
||||
Open=%cd %p/trpm://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/package.sh view trpm
|
||||
|
||||
# RPM packages (SuSE uses *.spm for source packages)
|
||||
regex/\.(src\.rpm|spm)$
|
||||
Open=%cd %p/rpm://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/package.sh view src.rpm
|
||||
|
||||
regex/\.rpm$
|
||||
Open=%cd %p/rpm://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/package.sh view rpm
|
||||
|
||||
# deb
|
||||
regex/\.u?deb$
|
||||
Open=%cd %p/deb://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/package.sh view deb
|
||||
|
||||
# dpkg
|
||||
shell/.debd
|
||||
Open=%cd %p/debd://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/package.sh view debd
|
||||
|
||||
# apt
|
||||
shell/.deba
|
||||
Open=%cd %p/deba://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/package.sh view deba
|
||||
|
||||
# ISO9660
|
||||
regex/\.([iI][sS][oO])$
|
||||
Open=%cd %p/iso9660://
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view iso9660
|
||||
|
||||
regex/\.(diff|patch)(\.(gz|Z))$
|
||||
Open=%cd %p/patchfs://
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null
|
||||
|
||||
regex/\.(diff|patch)$
|
||||
Open=%cd %p/patchfs://
|
||||
View=%view{ascii} /bin/cat %f 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view cat
|
||||
|
||||
# ar library
|
||||
regex/\.s?a$
|
||||
Open=%cd %p/uar://
|
||||
#Open=%view{ascii} ar tv %f
|
||||
View=%view{ascii} file %f && nm -C %f
|
||||
|
||||
# trpm
|
||||
regex/\.trpm$
|
||||
Open=%cd %p/trpm://
|
||||
View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
|
||||
|
||||
# RPM packages (SuSE uses *.spm for source packages)
|
||||
regex/\.(src\.rpm|spm)$
|
||||
Open=%cd %p/rpm://
|
||||
View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
|
||||
|
||||
regex/\.rpm$
|
||||
Open=%cd %p/rpm://
|
||||
View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
|
||||
|
||||
# deb
|
||||
regex/\.u?deb$
|
||||
Open=%cd %p/deb://
|
||||
View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f
|
||||
|
||||
# dpkg
|
||||
shell/.debd
|
||||
Open=%cd %p/debd://
|
||||
View=%view{ascii} dpkg -s `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`
|
||||
# apt
|
||||
shell/.deba
|
||||
Open=%cd %p/deba://
|
||||
View=%view{ascii} apt-cache show `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`
|
||||
|
||||
# ISO9660
|
||||
regex/\.([iI][sS][oO])$
|
||||
Open=%cd %p/iso9660://
|
||||
View=%view{ascii} isoinfo -l -i %f
|
||||
|
||||
# 7zip archives (they are not man pages)
|
||||
regex/\.(7z|7Z)$
|
||||
Open=%cd %p/u7z://
|
||||
View=%view{ascii} 7za l %f 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view ar
|
||||
|
||||
# Mailboxes
|
||||
type/^ASCII\ mail\ text
|
||||
@ -300,12 +302,12 @@ include/editor
|
||||
|
||||
# .so libraries
|
||||
regex/\.(so|so\.[0-9\.]*)$
|
||||
View=%view{ascii} file %f && nm -C -D %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view so
|
||||
|
||||
# Object
|
||||
type/^ELF
|
||||
#Open=%var{PAGER:more} %f
|
||||
View=%view{ascii} file %f && nm -C %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view elf
|
||||
|
||||
### Documentation ###
|
||||
|
||||
@ -314,10 +316,10 @@ type/^ELF
|
||||
|
||||
# GNU Info page
|
||||
type/^Info\ text
|
||||
Open=info -f %f
|
||||
Open=@EXTHELPERSDIR@/text.sh open info
|
||||
|
||||
shell/.info
|
||||
Open=info -f %f
|
||||
Open=@EXTHELPERSDIR@/text.sh open info
|
||||
|
||||
# Exception: .3gp are video files not manual pages
|
||||
regex/\.(3[gG][pP])$
|
||||
@ -325,13 +327,13 @@ regex/\.(3[gG][pP])$
|
||||
|
||||
# Manual page
|
||||
regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$
|
||||
Open=case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
|
||||
Open=@EXTHELPERSDIR@/text.sh open man %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man %var{PAGER:more}
|
||||
|
||||
# Perl pod page
|
||||
shell/.pod
|
||||
Open=pod2man %f | nroff @MAN_FLAGS@ @MANDOC@ | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} pod2man %f | nroff @MAN_FLAGS@ @MANDOC@
|
||||
Open=@EXTHELPERSDIR@/text.sh open pod %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view pod %var{PAGER:more}
|
||||
|
||||
# Troff with me macros.
|
||||
# Exception - "read.me" is not a nroff file.
|
||||
@ -340,38 +342,38 @@ shell/read.me
|
||||
View=
|
||||
|
||||
shell/.me
|
||||
Open=nroff @MAN_FLAGS@ -me %f | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} nroff @MAN_FLAGS@ -me %f
|
||||
Open=@EXTHELPERSDIR@/text.sh open nroff.me %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view nroff.me %var{PAGER:more}
|
||||
|
||||
# Troff with ms macros.
|
||||
shell/.ms
|
||||
Open=nroff @MAN_FLAGS@ -ms %f | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} nroff @MAN_FLAGS@ -ms %f
|
||||
Open=@EXTHELPERSDIR@/text.sh open nroff.ms %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view nroff.ms %var{PAGER:more}
|
||||
|
||||
# Manual page - compressed
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$
|
||||
Open=case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
|
||||
Open=@EXTHELPERSDIR@/text.sh open man.gz %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.gz %var{PAGER:more}
|
||||
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$
|
||||
Open=case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
|
||||
Open=@EXTHELPERSDIR@/text.sh open man.bz %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.bz %var{PAGER:more}
|
||||
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$
|
||||
Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
|
||||
Open=@EXTHELPERSDIR@/text.sh open man.bz2 %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.bz2 %var{PAGER:more}
|
||||
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$
|
||||
Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
|
||||
Open=@EXTHELPERSDIR@/text.sh open man.lzma %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.lzma %var{PAGER:more}
|
||||
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.xz$
|
||||
Open=case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
|
||||
Open=@EXTHELPERSDIR@/text.sh open man.xz %var{PAGER:more}
|
||||
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.xz %var{PAGER:more}
|
||||
|
||||
# CHM
|
||||
regex/\.(chm|CHM)$
|
||||
Open=which kchmviewer > /dev/null 2>&1 && (kchmviewer %f &) || (xchm %f &)
|
||||
Open=@EXTHELPERSDIR@/text.sh open chm
|
||||
|
||||
### Images ###
|
||||
|
||||
@ -379,7 +381,7 @@ type/^GIF
|
||||
Include=image
|
||||
|
||||
type/^JPEG
|
||||
View=%view{ascii} identify %f; test -x /usr/bin/exif && echo && exif %f 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/image.sh view jpeg
|
||||
Include=image
|
||||
|
||||
type/^PC\ bitmap
|
||||
@ -404,59 +406,57 @@ type/^Netpbm
|
||||
Include=image
|
||||
|
||||
shell/.xcf
|
||||
Open=(gimp %f &)
|
||||
Open=@EXTHELPERSDIR@/image.sh open xcf
|
||||
|
||||
shell/.xbm
|
||||
Open=bitmap %f
|
||||
Open=@EXTHELPERSDIR@/image.sh open xbm
|
||||
|
||||
shell/.xpm
|
||||
Include=image
|
||||
View=sxpm %f
|
||||
View=@EXTHELPERSDIR@/image.sh view xpm %f
|
||||
|
||||
shell/.ico
|
||||
Include=image
|
||||
|
||||
include/image
|
||||
Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (gqview %f &); fi
|
||||
View=%view{ascii} identify %f
|
||||
#View=%view{ascii} asciiview %f
|
||||
Open=@EXTHELPERSDIR@/image.sh open ALL_FORMATS
|
||||
View=%view{ascii} @EXTHELPERSDIR@/image.sh view ALL_FORMATS
|
||||
|
||||
|
||||
### Sound files ###
|
||||
|
||||
regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$
|
||||
Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi
|
||||
Open=@EXTHELPERSDIR@/sound.sh open common
|
||||
|
||||
regex/\.([mM][oO][dD]|[sS]3[mM]|[xX][mM]|[iI][tT]|[mM][tT][mM]|669|[sS][tT][mM]|[uU][lL][tT]|[fF][aA][rR])$
|
||||
Open=mikmod %f
|
||||
#Open=tracker %f
|
||||
Open=@EXTHELPERSDIR@/sound.sh open mod
|
||||
|
||||
regex/\.([wW][aA][wW]22)$
|
||||
Open=vplay -s 22 %f
|
||||
Open=@EXTHELPERSDIR@/sound.sh open wav22
|
||||
|
||||
regex/\.([mM][pP]3)$
|
||||
Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
|
||||
View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
|
||||
Open=@EXTHELPERSDIR@/sound.sh open mp3
|
||||
View=%view{ascii} @EXTHELPERSDIR@/sound.sh view mp3
|
||||
|
||||
regex/\.([oO][gG][gG|aA|vV|xX])$
|
||||
Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
|
||||
View=%view{ascii} ogginfo %s
|
||||
Open=@EXTHELPERSDIR@/sound.sh open ogg
|
||||
View=%view{ascii} @EXTHELPERSDIR@/sound.sh view ogg
|
||||
|
||||
regex/\.([sS][pP][xX]|[fF][lL][aA][cC])$
|
||||
Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi
|
||||
Open=@EXTHELPERSDIR@/sound.sh open common
|
||||
|
||||
regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$
|
||||
Open=timidity %f
|
||||
Open=@EXTHELPERSDIR@/sound.sh open midi
|
||||
|
||||
regex/\.([wW][mM][aA])$
|
||||
Open=mplayer -vo null %f
|
||||
View=%view{ascii} mplayer -quiet -slave -frames 0 -vo null -ao null -identify %f 2>/dev/null | tail +13 || file %f
|
||||
Open=@EXTHELPERSDIR@/sound.sh open wma
|
||||
View=%view{ascii} @EXTHELPERSDIR@/sound.sh view wma
|
||||
|
||||
|
||||
### Play lists ###
|
||||
|
||||
regex/\.([mM]3[uU]|[pP][lL][sS])$
|
||||
Open=if [ -z "$DISPLAY" ]; then mplayer -vo null -playlist %f; else (xmms -p %f >/dev/null 2>&1 &); fi
|
||||
Open=@EXTHELPERSDIR@/sound.sh open playlist
|
||||
|
||||
|
||||
### Video ###
|
||||
@ -499,81 +499,74 @@ regex/\.([oO][gG][mM])$
|
||||
Include=video
|
||||
|
||||
regex/\.([rR][aA]?[mM])$
|
||||
Open=(realplay %f >/dev/null 2>&1 &)
|
||||
Open=@EXTHELPERSDIR@/video.sh open ram
|
||||
|
||||
include/video
|
||||
Open=(mplayer %f >/dev/null 2>&1 &)
|
||||
#Open=(gtv %f >/dev/null 2>&1 &)
|
||||
#Open=(xanim %f >/dev/null 2>&1 &)
|
||||
Open=@EXTHELPERSDIR@/video.sh open ALL_FORMATS
|
||||
|
||||
|
||||
### Documents ###
|
||||
|
||||
# Postscript
|
||||
type/^PostScript
|
||||
Open=(gv %f &)
|
||||
View=%view{ascii} ps2ascii %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open ps
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view ps
|
||||
|
||||
# PDF
|
||||
type/^PDF
|
||||
Open=(xpdf %f &)
|
||||
#Open=(acroread %f &)
|
||||
#Open=(ghostview %f &)
|
||||
View=%view{ascii} pdftotext %f -
|
||||
|
||||
# The following code very ugly and should not be taken as example.
|
||||
# It should be cleaned up when the new format of mc.ext is developed.
|
||||
Open=@EXTHELPERSDIR@/doc.sh open pdf
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view pdf
|
||||
|
||||
# html
|
||||
regex/\.([hH][tT][mM][lL]?)$
|
||||
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
|
||||
View=%view{ascii} links -dump %f 2>/dev/null || w3m -dump %f 2>/dev/null || lynx -dump -force_html %f
|
||||
Open=@EXTHELPERSDIR@/web.sh open html
|
||||
View=%view{ascii} @EXTHELPERSDIR@/web.sh view html
|
||||
|
||||
# StarOffice 5.2
|
||||
shell/.sdw
|
||||
Open=(ooffice %f &)
|
||||
Open=@EXTHELPERSDIR@/doc.sh open oofice
|
||||
|
||||
# StarOffice 6 and OpenOffice.org formats
|
||||
regex/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
|
||||
Open=(ooffice %f &)
|
||||
View=%view{ascii} odt2txt %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open oofice
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view odt
|
||||
|
||||
# AbiWord
|
||||
shell/.abw
|
||||
Open=(abiword %f &)
|
||||
Open=@EXTHELPERSDIR@/doc.sh open abw
|
||||
|
||||
# Microsoft Word Document
|
||||
regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
|
||||
Open=(abiword %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open msdoc
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view msdoc
|
||||
type/^Microsoft\ Word
|
||||
Open=(abiword %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open msdoc
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view msdoc
|
||||
|
||||
# RTF document
|
||||
regex/\.([rR][tT][fF])$
|
||||
Open=(abiword %f >/dev/null 2>&1 &)
|
||||
Open=@EXTHELPERSDIR@/doc.sh open msdoc
|
||||
|
||||
# Microsoft Excel Worksheet
|
||||
regex/\.([xX][lL][sSwW])$
|
||||
Open=(gnumeric %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} xls2csv %f || strings %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open msxls
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view msxls
|
||||
type/^Microsoft\ Excel
|
||||
Open=(gnumeric %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} xls2csv %f || strings %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open msxls
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view msxls
|
||||
|
||||
# Use OpenOffice.org to open any MS Office documents
|
||||
type/^Microsoft\ Office\ Document
|
||||
Open=(ooffice %f &)
|
||||
Open=@EXTHELPERSDIR@/doc.sh open oofice
|
||||
|
||||
# Framemaker
|
||||
type/^FrameMaker
|
||||
Open=fmclient -f %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open framemaker
|
||||
|
||||
# DVI
|
||||
regex/\.([dD][vV][iI])$
|
||||
Open=if [ x$DISPLAY = x ]; then dvisvga %f; else (xdvi %f &); fi
|
||||
View=%view{ascii} dvi2tty %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open dvi
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view dvi
|
||||
|
||||
# TeX
|
||||
regex/\.([Tt][Ee][Xx])$
|
||||
@ -581,8 +574,8 @@ regex/\.([Tt][Ee][Xx])$
|
||||
|
||||
# DjVu
|
||||
regex/\.(djvu?|DJVU?)$
|
||||
Open=djview %f &
|
||||
View=%view{ascii} djvused -e print-pure-txt %f
|
||||
Open=@EXTHELPERSDIR@/doc.sh open djvu
|
||||
View=%view{ascii} @EXTHELPERSDIR@/doc.sh view djvu
|
||||
|
||||
### Miscellaneous ###
|
||||
|
||||
@ -592,7 +585,7 @@ regex/[Mm]akefile$
|
||||
|
||||
# Imakefile
|
||||
shell/Imakefile
|
||||
Open=xmkmf -a
|
||||
Open=@EXTHELPERSDIR@/misc.sh open imakefile
|
||||
|
||||
# Makefile.PL (MakeMaker)
|
||||
regex/^Makefile.(PL|pl)$
|
||||
@ -600,8 +593,8 @@ regex/^Makefile.(PL|pl)$
|
||||
|
||||
# dbf
|
||||
regex/\.([dD][bB][fF])$
|
||||
Open=%view{ascii} dbview %f
|
||||
View=%view{ascii} dbview -b %f
|
||||
Open=%view{ascii} @EXTHELPERSDIR@/misc.sh open dbf
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view dbf
|
||||
|
||||
# REXX script
|
||||
regex/\.(rexx?|cmd)$
|
||||
@ -615,81 +608,81 @@ regex/\.(d64|D64)$
|
||||
|
||||
# Glade, a user interface designer for GTK+ and GNOME
|
||||
regex/\.([Gg][Ll][Aa][Dd][Ee])$
|
||||
Open=if glade-3 --version >/dev/null 2>&1; then (glade-3 %f >/dev/null 2>&1 &); else (glade-2 %f >/dev/null 2>&1 &); fi
|
||||
Open=@EXTHELPERSDIR@/misc.sh open glade
|
||||
|
||||
# Gettext Catalogs
|
||||
shell/.mo
|
||||
View=%view{ascii} msgunfmt %f || cat %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view mo
|
||||
|
||||
# lyx
|
||||
regex/\.(lyx|LYX)$
|
||||
Open=lyx %f
|
||||
View=%view{ascii} lyxcat %f
|
||||
Open=@EXTHELPERSDIR@/misc.sh open lyx
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view lyx
|
||||
|
||||
# torrent
|
||||
regex/\.([tT][oO][rR][rR][eE][nN][tT])$
|
||||
View=%view{ascii} ctorrent -x %f 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/misc.sh view torrent
|
||||
|
||||
### Plain compressed files ###
|
||||
|
||||
# ace
|
||||
regex/\.(ace|ACE)$
|
||||
Open=%cd %p/uace://
|
||||
View=%view{ascii} unace l %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view ace
|
||||
Extract=unace x %f
|
||||
|
||||
# arc
|
||||
regex/\.(arc|ARC)$
|
||||
Open=%cd %p/uarc://
|
||||
View=%view{ascii} arc l %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view arc
|
||||
Extract=arc x %f '*'
|
||||
Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi
|
||||
|
||||
# zip
|
||||
type/^([Zz][Ii][Pp])\ archive
|
||||
Open=%cd %p/uzip://
|
||||
View=%view{ascii} unzip -v %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view zip
|
||||
|
||||
# zoo
|
||||
regex/\.([Zz][Oo][Oo])$
|
||||
Open=%cd %p/uzoo://
|
||||
View=%view{ascii} zoo l %f
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view zoo
|
||||
|
||||
# gzip
|
||||
type/^gzip
|
||||
Open=gzip -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null
|
||||
Open=@EXTHELPERSDIR@/archive.sh view gz %var{PAGER:more}
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view gz
|
||||
|
||||
regex/\.(gz|Z)$
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view gz
|
||||
|
||||
# bzip2
|
||||
type/^bzip2
|
||||
Open=bzip2 -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} bzip2 -dc %f 2>/dev/null
|
||||
Open=@EXTHELPERSDIR@/archive.sh view bzip2 %var{PAGER:more}
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view bz2
|
||||
|
||||
regex/\.bz2?$
|
||||
View=%view{ascii} bzip2 -dc %f 2>/dev/null
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view bz2
|
||||
|
||||
# bzip
|
||||
type/^bzip
|
||||
Open=bzip -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} bzip -dc %f 2>/dev/null
|
||||
Open=@EXTHELPERSDIR@/archive.sh view bzip %var{PAGER:more}
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view bzip
|
||||
|
||||
# compress
|
||||
type/^compress
|
||||
Open=gzip -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null
|
||||
Open=@EXTHELPERSDIR@/archive.sh view gz %var{PAGER:more}
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view gz
|
||||
|
||||
# lzma
|
||||
regex/\.lzma$
|
||||
Open=lzma -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} lzma -dc %f 2>/dev/null
|
||||
Open=@EXTHELPERSDIR@/archive.sh view lzma %var{PAGER:more}
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view lzma
|
||||
|
||||
# xz
|
||||
regex/\.xz$
|
||||
Open=xz -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} xz -dc %f 2>/dev/null
|
||||
Open=@EXTHELPERSDIR@/archive.sh view xz %var{PAGER:more}
|
||||
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view xz
|
||||
|
||||
### Default ###
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user