From: Oleg Broytman Date: Tue, 30 Jun 2020 09:16:52 +0000 (+0300) Subject: .mc: Update `mc.ext` X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=commitdiff_plain;h=3b34c0d9e7422716e8625bafe62d2e033c3e3e11 .mc: Update `mc.ext` --- diff --git a/.mc/mc.ext b/.mc/mc.ext index c032ee6..7f3b9cd 100644 --- a/.mc/mc.ext +++ b/.mc/mc.ext @@ -1,3 +1,122 @@ +### phd + +type/^Berkeley\ DB\ 1.85 + View=%view{ascii} db_dump185 -p %f + +# Compiled HTML +#shell/.chm +# Open=fbreader %f & +# +## DejaVu +#shell/.djvu +# Open=djview %f & +# +# EPUB +shell/.epub + Open=fbreader %f & + +# FB2 +shell/.fb2 + Open=fbreader %f & + View=%view{ascii} xsltproc /usr/local/src/distr/FictionBook/FB2_2_txt_ru.xsl %f + +#type/^PostScript +# Open=libreoffice %f & +# View=%view{ascii} ps2ascii %f +# +## RTF +#regex/i/\.rtf$ +# Open=fbreader %f & +# View=%view{ascii} catdoc %f +# +#regex/i/\.(doc|wri)$ +# Include=msoffice-doc +# +regex/i/\.docx$ + Edit=libreoffice %f & + Open=libreoffice %f & + View=%view{ascii} docx2txt %f - | iconv.py -f utf-8 + +type/^Microsoft\ Word 2007+ + Include=msoffice-doc + +type/^Microsoft\ Office\ Document + Include=msoffice-doc + +regex/i/\.xlsx$ + Include=msoffice-xlsx + +type/^Microsoft\ Excel 2007+ + Include=msoffice-xlsx + +#type/^Composite\ Document\ File +# Include=msoffice-doc +# +# ftplist +regex/\.ftplist$ + Open=%cd %p#ftplist + +# Play list +regex/i/\.(m3u|pls)$ + Include=audio + +# Lossless audio +regex/\.(cue|aac|ac3|ape|flac|wv|mka)$ + Include=audio + +## Object +#shell/.o +# View=%view{ascii} nm %f +# Disassemble=%view{ascii} objdump -d -r %f +# +## Python +#shell/.py +# Open=python %f +# View=%view{ascii} +# Compile=compyle %s +# Icon=snake.xpm +# +#regex/i/\.tiff?$ +# Open=xview %f +# +shell/.torrent + Open=%cd %p/torrent:// + +regex/i/\.xml$ + Include=xml + +type/^XML *(1\.0 *)?document + Include=xml + +#regex/i/\.zip$ +# Open=%cd %p/uzip:// +# View=%view{ascii} unzip -v %f +# +include/audio + Open=[ "`audtool --get-volume`" -eq 0 ] && (audacious & sleep 3); audtool --playlist-clear --playlist-addurl %f --playback-play + #Open=mplayer %f & + #Open=deadbeef %f & + View=%view{ascii} %f + +include/msoffice-doc + Edit=libreoffice %f & + Open=libreoffice %f & + View=%view{ascii} catdoc %f + +include/msoffice-xlsx + Edit=libreoffice %f & + Open=libreoffice %f & + View=%view{ascii} xlsx2csv %f | iconv.py -f utf-8 + +#include/video +# Open=mplayer %f & +# View=%view{ascii} %f +# +include/xml + Open=%cd %p/xml:// + +### /phd + # Midnight Commander 3.0 extension file # Warning: Structure of this file has changed completely with version 3.0 # @@ -12,14 +131,23 @@ # i.e. matches all the files *desc . Example: .tar matches *.tar; # if it doesn't start with a dot, it matches only a file of that name) # +# shell/i (desc is, when starting with a dot, any extension (no wildcars), +# The same as shell but with case insensitive. +# # regex (desc is an extended regular expression) # Please note that we are using the GNU regex library and thus # \| matches the literal | and | has special meaning (or) and # () have special meaning and \( \) stand for literal ( ). # +# regex/i (desc is an extended regular expression) +# The same as regex but with case insensitive. +# # type (file matches this if `file %f` matches regular expression desc # (the filename: part from `file %f` is removed)) # +# type/i (file matches this if `file %f` matches regular expression desc) +# The same as type but with case insensitive. +# # directory (matches any directory matching regular expression desc) # # include (matches an include directive) @@ -40,7 +168,9 @@ # command is any one-line shell command, with the following substitutions: # # %% -> % character -# %p -> name of the current file (without path, but pwd is its path) +# %p -> name of the current file (without path, but pwd is its path). +# Also provided to external application as MC_EXT_BASENAME +# global variable # %f -> name of the current file. Unlike %p, if file is located on a # non-local virtual filesystem, i.e. either tarfs or ftpfs, # then the file will be temporarily copied into a local directory @@ -48,10 +178,18 @@ # If you don't want to get a local copy and want to get the # virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then # use %d/%p instead of %f. +# Also provided to external application as MC_EXT_FILENAME +# global variable # %d -> name of the current directory (pwd, without trailing slash) +# Also provided to external application as MC_EXT_CURRENTDIR +# global variable # %s -> "selected files", i.e. space separated list of tagged files if any -# or name of the current file +# or name of the current file. +# Also provided to external application as MC_EXT_SELECTED +# global variable # %t -> list of tagged files +# Also provided to external application as MC_EXT_ONLYTAGGED +# global variable # %u -> list of tagged files (they'll be untaged after the command) # # (If these 6 letters are in uppercase, they refer to the other panel. @@ -87,21 +225,7 @@ ### Changes ### # -# Reorganization: 2000-05-01 Michal Svec - - -### TODO ### -# -# Postscript Open: ps2svga [gs -DEVICE=jpeg|zgv or something] -# Images asciiview -# -# All X Apps [Nothing/Warning] if no DISPLAY -# Not found [Default/Warning] -# Empty Output [Default/Warning] -# Edit: CopyOut+EDIT+CopyIn -# Security Check gzip/bzip EDIT (mktemp) -# -# Maybe: Open/XOpen/GOpen/KOpen/... for Console/X/GNOME/KDE/etc. +# Reorganization: 2012-03-07 Slava Zanko ### GIT Repo ### @@ -112,151 +236,199 @@ regex/^\[git\] ### Archives ### -# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk -regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk|\.gem$ +# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk, .gem +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} /usr/lib/mc/ext.d/archive.sh view tar.gz -regex/\.tar\.bz$ +shell/.tar.bz # Open=%cd %p/utar:// - View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf - + View=%view{ascii} /usr/lib/mc/ext.d/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} /usr/lib/mc/ext.d/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} /usr/lib/mc/ext.d/archive.sh view tar.lzma + +# .tar.lz +shell/.tar.lz + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.lz + +# .tar.lz4, .tlz4 +regex/\.t(ar\.lz4|lz4)$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.lz4 # .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} /usr/lib/mc/ext.d/archive.sh view tar.xz + +# .tar.zst, .tzst +regex/\.t(ar\.zst|zst)$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.zst # .tar.F - used in QNX -regex/\.tar\.F$ +shell/.tar.F # Open=%cd %p/utar:// - View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf - + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.F # .qpr/.qpk - QNX Neutrino package installer files -regex/\.(qp[rk])$ +regex/\.qp[rk]$ Open=%cd %p/utar:// - View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf - + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.qpr # tar -regex/\.(tar|TAR)$ +shell/i/.tar Open=%cd %p/utar:// - View=%view{ascii} tar tvvf - < %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar # lha type/^LHa\ .*archive Open=%cd %p/ulha:// - View=%view{ascii} lha l %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lha # arj -regex/\.[aA]([rR][jJ]|[0-9][0-9])$ +regex/i/\.a(rj|[0-9][0-9])$ Open=%cd %p/uarj:// - View=%view{ascii} unarj l %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view arj # cab -regex/\.([cC][aA][bB])$ +shell/i/.cab Open=%cd %p/ucab:// - View=%view{ascii} cabextract -l %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cab # ha -regex/\.([Hh][Aa])$ +shell/i/.ha Open=%cd %p/uha:// - View=%view{ascii} ha lf %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view ha # rar -regex/\.[rR]([aA][rR]|[0-9][0-9])$ +regex/i/\.r(ar|[0-9][0-9])$ Open=%cd %p/urar:// - View=%view{ascii} unrar v -c- %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view rar # ALZip -regex/\.(alz|ALZ)$ +shell/i/.alz Open=%cd %p/ualz:// - View=%view{ascii} unalz -l %f + View=%view{ascii} /usr/lib/mc/ext.d/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} /usr/lib/mc/ext.d/archive.sh view cpio.z + +shell/.cpio.lz + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.lz + +shell/.cpio.lz4 + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.lz4 shell/.cpio.xz Open=%cd %p/ucpio:// - View=%view{ascii} xz -dc %f | cpio -itv 2>/dev/null + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.xz + +shell/.cpio.zst + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.zst shell/.cpio.gz Open=%cd %p/ucpio:// - View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.gz -shell/.cpio +shell/i/.cpio Open=%cd %p/ucpio:// - View=%view{ascii} cpio -itv < %f 2>/dev/null + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio -# ls-lR -regex/(^|\.)ls-?lR(\.gz|Z|bz2)$ - Open=%cd %p/lslR:// +# initrd +regex/^(initramfs.*\.img|initrd(-.+)?\.img(-.+)?)$ + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio + +# 7zip archives (they are not man pages) +shell/i/.7z + Open=%cd %p/u7z:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view 7z # patch regex/\.(diff|patch)(\.bz2)$ Open=%cd %p/patchfs:// - View=%view{ascii} bzip2 -dc %f 2>/dev/null + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bz2 regex/\.(diff|patch)(\.(gz|Z))$ Open=%cd %p/patchfs:// - View=%view{ascii} gzip -dc %f 2>/dev/null + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz -regex/\.(diff|patch)$ - Open=%cd %p/patchfs:// - View=%view{ascii} /bin/cat %f 2>/dev/null +regex/\.(diff|patch)(\.xz)$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view xz -# ar library -regex/\.s?a$ - Open=%cd %p/uar:// - #Open=%view{ascii} ar tv %f - View=%view{ascii} file %f && nm -C %f +regex/\.(diff|patch)(\.zst)$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zst + +# ls-lR +regex/(^|\.)ls-?lR(\.gz|Z|bz2)$ + Open=%cd %p/lslR:// # trpm -regex/\.trpm$ +shell/.trpm Open=%cd %p/trpm:// - View=%view{ascii} rpm -qivl --scripts `basename %p .trpm` + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view 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 + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view src.rpm -regex/\.rpm$ +shell/.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 + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view rpm # deb regex/\.u?deb$ Open=%cd %p/deb:// - View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view deb # dpkg shell/.debd Open=%cd %p/debd:// - View=%view{ascii} dpkg -s `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'` + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view debd + # apt shell/.deba Open=%cd %p/deba:// - View=%view{ascii} apt-cache show `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'` + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view deba # ISO9660 -regex/\.([iI][sS][oO](\.wv)?)$ +shell/i/.iso Open=%cd %p/iso9660:// - View=%view{ascii} isoinfo -l -i %f + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view iso9660 + + +regex/\.(diff|patch)$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view cat + +# ar library +regex/\.s?a$ + Open=%cd %p/uar:// + #Open=%view{ascii} ar tv %f + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view ar + +# gplib +shell/i/.lib + Open=%cd %p/ulib:// + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view lib -# 7zip archives (they are not man pages) -regex/\.(7z|7Z)$ - Open=%cd %p/u7z:// - View=%view{ascii} 7za l %f 2>/dev/null # Mailboxes type/^ASCII\ mail\ text @@ -265,37 +437,33 @@ type/^ASCII\ mail\ text ### Sources ### -# C -shell/.c - Include=editor - -# Fortran -shell/.f +# C/C++ +regex/i/\.(c|cc|cpp)$ Include=editor -# Header -regex/\.(h|hpp)$ +# C/C++ header +regex/i/\.(h|hh|hpp)$ Include=editor -# Asm -shell/.s +# Fortran +shell/i/.f Include=editor -# C++ -regex/\.(C|cc|cpp)$ +# Assembler +regex/i/\.(s|asm)$ Include=editor include/editor - Open=%var{EDITOR:vi} %f + Open=%var{EDITOR:editor} %f # .so libraries regex/\.(so|so\.[0-9\.]*)$ - View=%view{ascii} file %f && nm -C -D %f + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view so # Object type/^ELF #Open=%var{PAGER:more} %f - View=%view{ascii} file %f && nm -C %f + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view elf ### Documentation ### @@ -304,24 +472,24 @@ type/^ELF # GNU Info page type/^Info\ text - Open=info -f %f + Open=/usr/lib/mc/ext.d/text.sh open info shell/.info - Open=info -f %f + Open=/usr/lib/mc/ext.d/text.sh open info # Exception: .3gp are video files not manual pages -regex/\.(3[gG][pP])$ +shell/i/.3gp Include=video # 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 -c -Tlatin1 -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 -c -Tlatin1 -mandoc ;; esac + Open=/usr/lib/mc/ext.d/text.sh open man %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man %var{PAGER:more} # Perl pod page shell/.pod - Open=pod2man %f | nroff -c -Tlatin1 -mandoc | %var{PAGER:more} - View=%view{ascii,nroff} pod2man %f | nroff -c -Tlatin1 -mandoc + Open=/usr/lib/mc/ext.d/text.sh open pod %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view pod %var{PAGER:more} # Troff with me macros. # Exception - "read.me" is not a nroff file. @@ -330,38 +498,50 @@ shell/read.me View= shell/.me - Open=nroff -c -Tlatin1 -me %f | %var{PAGER:more} - View=%view{ascii,nroff} nroff -c -Tlatin1 -me %f + Open=/usr/lib/mc/ext.d/text.sh open nroff.me %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view nroff.me %var{PAGER:more} # Troff with ms macros. shell/.ms - Open=nroff -c -Tlatin1 -ms %f | %var{PAGER:more} - View=%view{ascii,nroff} nroff -c -Tlatin1 -ms %f + Open=/usr/lib/mc/ext.d/text.sh open nroff.ms %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/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 -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more} - View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac + Open=/usr/lib/mc/ext.d/text.sh open man.gz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/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 -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more} - View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac + Open=/usr/lib/mc/ext.d/text.sh open man.bz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/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 -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more} - View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff -c -Tlatin1 -mandoc ;; esac + Open=/usr/lib/mc/ext.d/text.sh open man.bz2 %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.bz2 %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz$ + Open=/usr/lib/mc/ext.d/text.sh open man.lz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.lz %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz4$ + Open=/usr/lib/mc/ext.d/text.sh open man.lz4 %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.lz4 %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 -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more} - View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff -c -Tlatin1 -mandoc ;; esac + Open=/usr/lib/mc/ext.d/text.sh open man.lzma %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/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 -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more} - View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff -c -Tlatin1 -mandoc ;; esac + Open=/usr/lib/mc/ext.d/text.sh open man.xz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.xz %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.zst$ + Open=/usr/lib/mc/ext.d/text.sh open man.zst %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.zst %var{PAGER:more} # CHM -regex/\.(chm|CHM)$ - Open=which kchmviewer > /dev/null 2>&1 && (kchmviewer %f &) || (xchm %f &) +shell/i/.chm + Open=/usr/lib/mc/ext.d/text.sh open chm ### Images ### @@ -369,7 +549,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} /usr/lib/mc/ext.d/image.sh view jpeg Include=image type/^PC\ bitmap @@ -378,6 +558,12 @@ type/^PC\ bitmap type/^PNG Include=image +type/^JNG + Include=image + +type/^MNG + Include=image + type/^TIFF Include=image @@ -394,192 +580,218 @@ type/^Netpbm Include=image shell/.xcf - Open=(gimp %f &) + Open=/usr/lib/mc/ext.d/image.sh open xcf shell/.xbm - Open=bitmap %f + Open=/usr/lib/mc/ext.d/image.sh open xbm shell/.xpm Include=image - View=sxpm %f + View=/usr/lib/mc/ext.d/image.sh view xpm %f shell/.ico Include=image +shell/i/.svg + View=%view{ascii} /usr/lib/mc/ext.d/image.sh view svg + Open=/usr/lib/mc/ext.d/image.sh open svg + include/image - Open=(see %f &) - View=%view{ascii} identify %f - #View=%view{ascii} asciiview %f + Open=/usr/lib/mc/ext.d/image.sh open ALL_FORMATS + View=%view{ascii} /usr/lib/mc/ext.d/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 -# -#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 -# -#regex/\.([wW][aA][wW]22)$ -# Open=vplay -s 22 %f -# -#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' -# -#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 -# -#regex/\.([sS][pP][xX]|[fF][lL][aA][cC])$ -# Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi -# -#regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$ -# Open=timidity %f -# -#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 -# -# -#### 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 +regex/i/\.(wav|snd|voc|au|smp|aiff|snd|m4a|ape|aac|wv)$ + Open=/usr/lib/mc/ext.d/sound.sh open common + +regex/i/\.(mod|s3m|xm|it|mtm|669|stm|ult|far)$ + Open=/usr/lib/mc/ext.d/sound.sh open mod + +shell/i/.waw22 + Open=/usr/lib/mc/ext.d/sound.sh open wav22 + +shell/i/.mp3 + Open=/usr/lib/mc/ext.d/sound.sh open mp3 + View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view mp3 + +regex/i/\.og[gax]$ + Open=/usr/lib/mc/ext.d/sound.sh open ogg + View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view ogg + +regex/i/\.(spx|flac)$ + Open=/usr/lib/mc/ext.d/sound.sh open common + +regex/i/\.(midi?|rmid?)$ + Open=/usr/lib/mc/ext.d/sound.sh open midi + +shell/i/.wma + Open=/usr/lib/mc/ext.d/sound.sh open wma + View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view wma + + +### Play lists ### + +regex/i/\.(m3u|pls)$ + Open=/usr/lib/mc/ext.d/sound.sh open playlist ### Video ### -regex/\.([aA][vV][iI])$ +shell/i/.avi Include=video -regex/\.([aA][sS][fFxX])$ +regex/i/\.as[fx]$ Include=video -regex/\.([dD][iI][vV][xX])$ +shell/i/.divx Include=video -regex/\.([mM][kK][vV])$ +shell/i/.mkv Include=video -regex/\.([mM][oO][vV]|[qQ][tT])$ +regex/i/\.(mov|qt)$ Include=video -regex/\.([mM][pP]4|[mM]4[vV]|[mM][pP][eE]?[gG])$ +regex/i/\.(mp4|m4v|mpe?g)$ Include=video # MPEG-2 TS container + H.264 codec -regex/\.([mM][tT][sS])$ +shell/i/.mts Include=video -regex/\.([tT][sS])$ +shell/i/.ts Include=video -regex/\.([vV][oO][bB])$ +shell/i/.vob Include=video -regex/\.([wW][mM][vV])$ +shell/i/.wmv Include=video -regex/\.([fF][lL][iIcCvV])$ +regex/i/\.fl[icv]$ Include=video -regex/\.([oO][gG][mM])$ +shell/i/.ogv Include=video -regex/\.([rR][aA]?[mM])$ - Open=(realplay %f >/dev/null 2>&1 &) +regex/i/\.ra?m$ + Open=/usr/lib/mc/ext.d/video.sh open ram -include/oldvideo - Open=(mplayer %f >/dev/null 2>&1 &) - #Open=(gtv %f >/dev/null 2>&1 &) - #Open=(xanim %f >/dev/null 2>&1 &) +# WebM +shell/i/.webm + Include=video + +type/WebM + Include=video + +include/video + Open=/usr/lib/mc/ext.d/video.sh open ALL_FORMATS + View=%view{ascii} /usr/lib/mc/ext.d/video.sh view ALL_FORMATS ### Documents ### # Postscript type/^PostScript -# Open=(gv %f &) - View=%view{ascii} ps2ascii %f + Open=/usr/lib/mc/ext.d/doc.sh open ps + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view ps # PDF type/^PDF - Edit=libreoffice %f & - Open=(see %f &) - #Open=(acroread %f &) - #Open=(ghostview %f &) - View=%view{ascii} pdftotext -layout -q %f - | iconv.py -f utf-8 - -# 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=/usr/lib/mc/ext.d/doc.sh open pdf + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf # html -regex/\.([hH][tT][mM][lL]?)$ - Open=(if test -n "" && test -n "$DISPLAY"; then ( 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 +regex/i/\.html?$ + Open=/usr/lib/mc/ext.d/web.sh open html + View=%view{ascii} /usr/lib/mc/ext.d/web.sh view html # StarOffice 5.2 shell/.sdw - Open=(libreoffice %f &) + Open=/usr/lib/mc/ext.d/doc.sh open ooffice # 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)$ - Edit=(libreoffice %f &) - Open=(libreoffice %f &) - View=%view{ascii} odt2txt %f +regex/i/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$ + Open=/usr/lib/mc/ext.d/doc.sh open ooffice + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view odt # AbiWord shell/.abw - Open=(abiword %f &) + Open=/usr/lib/mc/ext.d/doc.sh open abw + +# Gnumeric +shell/i/.gnumeric + Open=/usr/lib/mc/ext.d/doc.sh open gnumeric # 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 -#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 -# -## RTF document -#regex/\.([rR][tT][fF])$ -# Open=(abiword %f >/dev/null 2>&1 &) +regex/i/\.(do[ct]|wri|docx)$ + Open=/usr/lib/mc/ext.d/doc.sh open msdoc + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msdoc +type/^Microsoft\ Word + Open=/usr/lib/mc/ext.d/doc.sh open msdoc + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msdoc -# Microsoft Excel Worksheet -regex/\.([xX][lL][sSwW])$ - Open=(gnumeric %f >/dev/null 2>&1 &) - View=%view{ascii} xls2csv %f || strings %f -type/^Microsoft\ Excel$ - Open=(gnumeric %f >/dev/null 2>&1 &) - View=%view{ascii} xls2csv %f || strings %f +# RTF document +shell/i/.rtf + Open=/usr/lib/mc/ext.d/doc.sh open msdoc -# Use OpenOffice.org to open any MS Office documents -#type/^Microsoft\ Office\ Document -# Open=(libreoffice %f &) +# Microsoft Excel Worksheet +regex/i/\.(xl[sw]|xlsx)$ + Open=/usr/lib/mc/ext.d/doc.sh open msxls + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msxls +type/^Microsoft\ Excel + Open=/usr/lib/mc/ext.d/doc.sh open msxls + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msxls + +# Microsoft PowerPoint Presentation +regex/i/\.(pp[ts]|pptx)$ + Open=/usr/lib/mc/ext.d/doc.sh open msppt + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msppt + +# Use OpenOffice.org/LibreOffice to open any MS Office documents +type/^Microsoft\ Office\ Document + Open=/usr/lib/mc/ext.d/doc.sh open ooffice +type/^Microsoft\ OOXML + Open=/usr/lib/mc/ext.d/doc.sh open ooffice # Framemaker type/^FrameMaker - Open=fmclient -f %f + Open=/usr/lib/mc/ext.d/doc.sh open framemaker # DVI -regex/\.([dD][vV][iI])$ - Open=run-mailcap %f 2>&1 & - View=%view{ascii} catdvi %f +shell/i/.dvi + Open=/usr/lib/mc/ext.d/doc.sh open dvi + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view dvi # TeX -regex/\.([Tt][Ee][Xx])$ +shell/i/.tex Include=editor # DjVu -regex/\.(djvu?|DJVU?)$ - Open=djview %f & - View=%view{ascii} djvused -e print-pure-txt %f +regex/i/\.djvu?$ + Open=/usr/lib/mc/ext.d/doc.sh open djvu + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view djvu + +# Comic Books +regex/i/\.cb[zr]$ + Open=/usr/lib/mc/ext.d/doc.sh open comic + +# Epub & mobi +regex/i/\.(epub|mobi)$ + Open=/usr/lib/mc/ext.d/doc.sh open epub + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view epub + ### Miscellaneous ### +# Compiled Java classes +shell/.class + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view javaclass + # Makefile -regex/[Mm]akefile$ +regex/^[Mm]akefile$ Open=make -f %f %{Enter parameters} # Imakefile @@ -587,218 +799,144 @@ shell/Imakefile Open=xmkmf -a # Makefile.PL (MakeMaker) -regex/^Makefile.(PL|pl)$ +regex/^Makefile\.(PL|pl)$ Open=%var{PERL:perl} %f +# sqlite3.db +type/^SQLite 3.x database + Open=/usr/lib/mc/ext.d/misc.sh open sqlite + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view sqlite + # dbf -regex/\.([dD][bB][fF])$ - Open=%view{ascii} dbview %f - View=%view{ascii} dbview -b %f +shell/i/.dbf + Open=/usr/lib/mc/ext.d/misc.sh open dbf + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view dbf # REXX script regex/\.(rexx?|cmd)$ Open=rexx %f %{Enter parameters};echo "Press ENTER";read y # Disk images for Commodore computers (VIC20, C64, C128) -regex/\.(d64|D64)$ +shell/i/.d64 Open=%cd %p/uc1541:// View=%view{ascii} c1541 %f -list Extract=c1541 %f -extract # 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 +shell/i/.glade + Open=/usr/lib/mc/ext.d/misc.sh open glade # Gettext Catalogs -shell/.mo - View=%view{ascii} msgunfmt %f || cat %f +regex/\.g?mo$ + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view mo + +# po +shell/.po + Open=/usr/lib/mc/ext.d/misc.sh open po # lyx -regex/\.(lyx|LYX)$ - Open=lyx %f - View=%view{ascii} lyxcat %f +shell/i/.lyx + Open=/usr/lib/mc/ext.d/misc.sh open lyx + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view lyx # torrent -#regex/\.([tT][oO][rR][rR][eE][nN][tT])$ -# View=%view{ascii} ctorrent -x %f 2>/dev/null +shell/i/.torrent + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view torrent ### Plain compressed files ### # ace -regex/\.(ace|ACE)$ +shell/i/.ace Open=%cd %p/uace:// - View=%view{ascii} unace l %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view ace Extract=unace x %f # arc -regex/\.(arc|ARC)$ +shell/i/.arc Open=%cd %p/uarc:// - View=%view{ascii} arc l %f + View=%view{ascii} /usr/lib/mc/ext.d/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 +shell/i/.zip Open=%cd %p/uzip:// - View=%view{ascii} unzip -v %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zip + +# zip +type/i/^zip\ archive + Open=%cd %p/uzip:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zip + +# jar(zip) +type/i/^Java\ (Jar\ file|archive)\ data\ \((zip|JAR)\) + Open=%cd %p/uzip:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zip # zoo -regex/\.([Zz][Oo][Oo])$ +shell/i/.zoo Open=%cd %p/uzoo:// - View=%view{ascii} zoo l %f + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zoo # gzip type/^gzip - Open=gzip -dc %f | %var{PAGER:more} - View=%view{ascii} gzip -dc %f 2>/dev/null + Open=/usr/lib/mc/ext.d/archive.sh view gz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz regex/\.(gz|Z)$ - View=%view{ascii} gzip -dc %f 2>/dev/null + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz # bzip2 type/^bzip2 - Open=bzip2 -dc %f | %var{PAGER:more} - View=%view{ascii} bzip2 -dc %f 2>/dev/null + Open=/usr/lib/mc/ext.d/archive.sh view bzip2 %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bz2 regex/\.bz2?$ - View=%view{ascii} bzip2 -dc %f 2>/dev/null + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bz2 # bzip type/^bzip - Open=bzip -dc %f | %var{PAGER:more} - View=%view{ascii} bzip -dc %f 2>/dev/null + Open=/usr/lib/mc/ext.d/archive.sh view bzip %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bzip # compress type/^compress - Open=gzip -dc %f | %var{PAGER:more} - View=%view{ascii} gzip -dc %f 2>/dev/null + Open=/usr/lib/mc/ext.d/archive.sh view gz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz + +# lz +regex/\.lz$ + Open=/usr/lib/mc/ext.d/archive.sh view lz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lz + +# lz +type/^LZIP + Open=/usr/lib/mc/ext.d/archive.sh view lz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lz + +# lz4 +regex/\.lz4$ + Open=/usr/lib/mc/ext.d/archive.sh view lz4 %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lz4 # lzma regex/\.lzma$ - Open=lzma -dc %f | %var{PAGER:more} - View=%view{ascii} lzma -dc %f 2>/dev/null + Open=/usr/lib/mc/ext.d/archive.sh view lzma %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lzma # xz regex/\.xz$ - Open=xz -dc %f | %var{PAGER:more} - View=%view{ascii} xz -dc %f 2>/dev/null - -### phd + Open=/usr/lib/mc/ext.d/archive.sh view xz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view xz -type/^Berkeley\ DB\ 1.85 - View=%view{ascii} db_dump185 -p %f - -# Compiled HTML -shell/.chm - Open=fbreader %f & - -# DejaVu -shell/.djvu - Open=djview %f & - -# EPUB -shell/.epub - Open=fbreader %f & - -# FB2 -shell/.fb2 - Open=fbreader %f & - View=%view{ascii} xsltproc /usr/local/src/FictionBook/FB2_2_txt_ru.xsl %f - -type/^PostScript - Open=libreoffice %f & - View=%view{ascii} ps2ascii %f +# zstd +regex/\.zst$ + Open=/usr/lib/mc/ext.d/archive.sh view zst %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zst -# RTF -regex/\.([rR][tT][fF])$ - Open=fbreader %f & - View=%view{ascii} catdoc %f - -regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$ - Include=msoffice-doc - -regex/\.([Dd][oO][cC][Xx])$ - Edit=libreoffice %f & - Open=libreoffice %f & - View=%view{ascii} docx2txt %f - | iconv.py -f utf-8 - -type/^Microsoft\ Word - Include=msoffice-doc - -type/^Microsoft\ Office\ Document - Include=msoffice-doc - -regex/\.([xX][lL][sS][xX])$ - Include=msoffice-xlsx - -type/^Microsoft\ Excel 2007+ - Include=msoffice-xlsx - -type/^Composite\ Document\ File - Include=msoffice-doc - -# ftplist -regex/\.ftplist$ - Open=%cd %p#ftplist - -# Play list -regex/\.([mM]3[uU]|[pP][lL][sS])$ - Include=audio - -# Lossless audio -regex/\.(cue|aac|ac3|ape|flac|wv|mka)$ - Include=audio - -# Object -shell/.o - View=%view{ascii} nm %f - Disassemble=%view{ascii} objdump -d -r %f - -# Python -shell/.py - Open=python %f - View=%view{ascii} - Compile=compyle %s - Icon=snake.xpm - -regex/\.(tif|TIF|tiff|TIFF)$ - Open=xview %f - -shell/.torrent - Open=%cd %p/torrent:// - -regex/\.([xX][mM][lL])$ - Include=xml - -type/^XML *(1\.0 *)?document - Include=xml - -regex/\.([Zz][Ii][Pp])$ - Open=%cd %p/uzip:// - View=%view{ascii} unzip -v %f - -include/audio - Open=[ "`audtool --get-volume`" -eq 0 ] && (audacious & sleep 3); audtool --playlist-clear --playlist-addurl %f --playback-play - #Open=mplayer %f & - #Open=deadbeef %f & - View=%view{ascii} %f - -include/msoffice-doc - Edit=libreoffice %f & - Open=libreoffice %f & - View=%view{ascii} catdoc %f - -include/msoffice-xlsx - Edit=libreoffice %f & - Open=libreoffice %f & - View=%view{ascii} xlsx2csv %f | iconv.py -f utf-8 - -include/video - Open=mplayer %f & - View=%view{ascii} %f - -include/xml - Open=%cd %p/xml:// +# Parity Archive +type/^Parity\ Archive\ Volume\ Set + Open=/usr/lib/mc/ext.d/archive.sh open par2 ### Default ###