···2233let
44 mcExt = pkgs.writeText "mc.ext" ''
55- # gitfs changeset
66- regex/^\[git\]
77- Open=%cd %p/changesetfs://
88- View=%cd %p/patchsetfs://
99-1010- ### Archives ###
1111-1212- # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk, .gem
1313- regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$|\.gem$
1414- Open=%cd %p/utar://
1515-1616- shell/.tar.bz
1717- # Open=%cd %p/utar://
1818-1919- regex/\.t(ar\.bz2|bz2?|b2)$
2020- Open=%cd %p/utar://
2121-2222- # .tar.lzma, .tlz
2323- regex/\.t(ar\.lzma|lz)$
2424- Open=%cd %p/utar://
2525-2626- # .tar.xz, .txz
2727- regex/\.t(ar\.xz|xz)$
2828- Open=%cd %p/utar://
2929-3030- # .tar.F - used in QNX
3131- shell/.tar.F
3232- # Open=%cd %p/utar://
3333-3434- # .qpr/.qpk - QNX Neutrino package installer files
3535- regex/\.qp[rk]$
3636- Open=%cd %p/utar://
3737-3838- # tar
3939- shell/i/.tar
4040- Open=%cd %p/utar://
4141-4242- # lha
4343- type/^LHa\ .*archive
4444- Open=%cd %p/ulha://
4545-4646- # arj
4747- regex/i/\.a(rj|[0-9][0-9])$
4848- Open=%cd %p/uarj://
4949-5050- # cab
5151- shell/i/.cab
5252- Open=%cd %p/ucab://
5353-5454- # ha
5555- shell/i/.ha
5656- Open=%cd %p/uha://
5757-5858- # rar
5959- regex/i/\.r(ar|[0-9][0-9])$
6060- Open=%cd %p/urar://
6161-6262- # ALZip
6363- shell/i/.alz
6464- Open=%cd %p/ualz://
6565-6666- # cpio
6767- shell/.cpio.Z
6868- Open=%cd %p/ucpio://
6969-7070- shell/.cpio.xz
7171- Open=%cd %p/ucpio://
7272-7373- shell/.cpio.gz
7474- Open=%cd %p/ucpio://
7575-7676- shell/i/.cpio
7777- Open=%cd %p/ucpio://
7878-7979- # 7zip archives (they are not man pages)
8080- shell/i/.7z
8181- Open=%cd %p/u7z://
8282-8383- # patch
8484- regex/\.(diff|patch)(\.bz2)$
8585- Open=%cd %p/patchfs://
8686-8787- regex/\.(diff|patch)(\.(gz|Z))$
8888- Open=%cd %p/patchfs://
8989-9090- # ls-lR
9191- regex/(^|\.)ls-?lR(\.gz|Z|bz2)$
9292- Open=%cd %p/lslR://
9393-9494- # trpm
9595- shell/.trpm
9696- Open=%cd %p/trpm://
9797-9898- # RPM packages (SuSE uses *.spm for source packages)
9999- regex/\.(src\.rpm|spm)$
100100- Open=%cd %p/rpm://
101101-102102- shell/.rpm
103103- Open=%cd %p/rpm://
104104-105105- # deb
106106- regex/\.u?deb$
107107- Open=%cd %p/deb://
108108-109109- # dpkg
110110- shell/.debd
111111- Open=%cd %p/debd://
112112-113113- # apt
114114- shell/.deba
115115- Open=%cd %p/deba://
116116-117117- # ISO9660
118118- shell/i/.iso
119119- Open=%cd %p/iso9660://
120120-121121-122122- regex/\.(diff|patch)$
123123- Open=%cd %p/patchfs://
124124-125125- # ar library
126126- regex/\.s?a$
127127- Open=%cd %p/uar://
128128-129129- # gplib
130130- shell/i/.lib
131131- Open=%cd %p/ulib://
132132-133133-134134- # Mailboxes
135135- type/^ASCII\ mail\ text
136136- Open=%cd %p/mailfs://
137137-138138-139139- ### Sources ###
140140-141141- # C/C++
142142- regex/i/\.(c|cc|cpp)$
143143- Include=editor
144144-145145- # C/C++ header
146146- regex/i/\.(h|hh|hpp)$
147147- Include=editor
148148-149149- # Fortran
150150- shell/i/.f
151151- Include=editor
152152-153153- # Assembler
154154- regex/i/\.(s|asm)$
155155- Include=editor
156156-157157- include/editor
158158- Open=%var{EDITOR:vim} %f
159159-160160- ### Images ###
161161-162162- shell/i/.gif
163163- Include=image
164164-165165- regex/i/\.jpe?g$
166166- Include=image
167167-168168- shell/i/.bmp
169169- Include=image
170170-171171- shell/i/.png
172172- Include=image
173173-174174- shell/i/.jng
175175- Include=image
176176-177177- shell/i/.mng
178178- Include=image
179179-180180- shell/i/.tiff
181181- Include=image
182182-183183- shell/.ico
184184- Include=image
185185-186186- include/image
187187- Open=sxiv %f
188188- View=sxiv %f
189189-190190- ### Sound files ###
191191-192192- regex/i/\.(wav|snd|voc|au|smp|aiff|snd|m4a|ape|aac|wv)$
193193- Include=audio
194194-195195- regex/i/\.(mod|s3m|xm|it|mtm|669|stm|ult|far)$
196196- Include=audio
197197-198198- shell/i/.waw22
199199- Include=audio
200200-201201- shell/i/.mp3
202202- Include=audio
203203-204204- regex/i/\.og[gax]$
205205- Include=audio
206206-207207- regex/i/\.(spx|flac)$
208208- Include=audio
209209-210210- regex/i/\.(midi?|rmid?)$
211211- Include=audio
212212-213213- shell/i/.wma
214214- Include=audio
215215-216216- include/audio
217217- Open=mpv %f
218218- View=mpv %f
219219-220220- ### Video ###
221221-222222- shell/i/.avi
223223- Include=video
224224-225225- regex/i/\.as[fx]$
226226- Include=video
227227-228228- shell/i/.divx
229229- Include=video
230230-231231- shell/i/.rmvb
232232- Include=video
233233-234234- shell/i/.mkv
235235- Include=video
236236-237237- regex/i/\.(mov|qt)$
238238- Include=video
239239-240240- regex/i/\.(mp4|m4v|mpe?g)$
241241- Include=video
242242-243243- # MPEG-2 TS container + H.264 codec
244244- shell/i/.mts
245245- Include=video
246246-247247- shell/i/.ts
248248- Include=video
249249-250250- shell/i/.vob
251251- Include=video
252252-253253- shell/i/.wmv
254254- Include=video
255255-256256- regex/i/\.fl[icv]$
257257- Include=video
258258-259259- shell/i/.ogv
260260- Include=video
261261-262262- # WebM
263263- shell/i/.webm
264264- Include=video
265265-266266- type/WebM
267267- Include=video
268268-269269- include/video
270270- Open=mpv %f
271271- View=mpv %f
272272-273273-274274- ### Documents ###
275275-276276- # PDF
277277- shell/i/.pdf
278278- Open=zathura %f
279279- View=zathura %f
280280-281281- ### Miscellaneous ###
282282-283283- # Makefile
284284- regex/[Mm]akefile$
285285- Open=make -f %f %{Enter parameters}
286286-287287-288288- ### Plain compressed files ###
289289-290290- # ace
291291- shell/i/.ace
292292- Open=%cd %p/uace://
293293- Extract=unace x %f
294294-295295- # arc
296296- shell/i/.arc
297297- Open=%cd %p/uarc://
298298- Extract=arc x %f '*'
299299- Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi
300300-301301- # zip
302302- shell/i/.zip
303303- Open=%cd %p/uzip://
304304-305305- # zip
306306- type/i/^zip\ archive
307307- Open=%cd %p/uzip://
308308-309309- # jar(zip)
310310- type/i/^Java\ Jar\ file\ data\ \(zip\)
311311- Open=%cd %p/uzip://
312312-313313- # zoo
314314- shell/i/.zoo
315315- Open=%cd %p/uzoo://
316316-317317- ### Default ###
55+ # Midnight Commander 4.0 extension file
66+ #
77+ # Warning: The structure of this file has been completely changed with the version 4.0!
88+ #
99+ # All lines starting with # or empty lines are ignored.
1010+ #
1111+ # IMPORTANT: mc scans this file only upon first use or after editing it using the
1212+ # mc "Edit extension file" command (F9-c-e). If you edit this file in any other way
1313+ # while mc is running, you will need to press F9-c-e and exit the editor for your
1414+ # changes to take effect, or exit mc and start it again.
1515+ #
1616+ # Section name can be anything with following exceptions:
1717+ # there are two reserved section names:
1818+ # mc.ext.ini
1919+ # Default
2020+ # special name pattern:
2121+ # Include/xxxxx
2222+ # See below for more details.
2323+ #
2424+ # Section [mc.ext.ini] is mandatory. It contains file metadata.
2525+ # "Version" parameter is mandatory. It contains the file format version.
2626+ #
2727+ # Section [Default] is optional. It is applied only if no other match was found.
2828+ #
2929+ # Sections like [Include/xxxx] can be referenced as "Include=xxxx" from other sections.
3030+ # Section [Include/xxxx] can be located as before as after sections that point to it.
3131+ #
3232+ # Sections are processed from top to bottom, thus the order is important.
3333+ # If there are more than one sections with the same name in this file, the first
3434+ # section will be used.
3535+ #
3636+ # [Default] should be a catch-all action and come last.
3737+ #
3838+ # A section describing a file can contain following keys:
3939+ #
4040+ # File descriptions:
4141+ #
4242+ # Directory
4343+ # Matches any directory matching regular expression.
4444+ # Always case sensitive.
4545+ # This key has the highest priority over other keys. If this key is in a section,
4646+ # other keys are ignored.
4747+ #
4848+ # Type
4949+ # Matches files if `file %f` matches regular expression
5050+ # (the "filename:" part is removed from `file %f` output).
5151+ # Ignored if the "file" utility isn't used (not found during the configure step
5252+ # or disabled in the ini-file).
5353+ #
5454+ # TypeIgnoreCase [true|false]
5555+ # Defines whether the Type value is case sensitive or not.
5656+ # If absent, Type is case sensitive.
5757+ #
5858+ # Regex
5959+ # An extended regular expression
6060+ # Please note that we are using the PCRE library and thus \| matches
6161+ # the literal | and | has a special meaning (or), and () have a special meaning
6262+ # and \( \) stand for literal ( ).
6363+ #
6464+ # Example:
6565+ # Regex=\.t(ar\.lzma|lz)$
6666+ # matches *.tar.lzma or *.tlz.
6767+ #
6868+ # RegexIgnoreCase [true|false]
6969+ # Defines whether the Regex value is case sensitive or not.
7070+ # If absent, Regex is case sensitive.
7171+ #
7272+ # Shell
7373+ # Describes an extension when starting with a dot (no wildcards).
7474+ #
7575+ # Example:
7676+ # Shell=.tar
7777+ # matches *.tar.
7878+ #
7979+ # If it doesn't start with a dot, it matches only a file of that name.
8080+ #
8181+ # If both keys Regex and Shell are in the same section, Regex is used
8282+ # and Shell is ignored.
8383+ #
8484+ # ShellIgnoreCase [true|false]
8585+ # Defines whether the Shell value is case sensitive or not.
8686+ # If absent, Shell is case sensitive.
8787+ #
8888+ # Include
8989+ # Reference to another section.
9090+ #
9191+ # Example:
9292+ # Include=video
9393+ # points to the [Include/video] section.
9494+ #
9595+ # Commands:
9696+ #
9797+ # Open
9898+ # Execute the command if the user presses Enter or doubleclicks it.
9999+ #
100100+ # View
101101+ # Execute the command if the user presses F3.
102102+ #
103103+ # Edit
104104+ # Execute the command if the user presses F4.
105105+ #
106106+ # All commands are ignored if the section contains the Include key.
107107+ #
108108+ # Command is any one-line shell command, with the following substitutions:
109109+ #
110110+ # %%
111111+ # The % character
112112+ #
113113+ # %p
114114+ # Name of the current file without the path.
115115+ # Also provided to the external application as MC_EXT_BASENAME environment variable.
116116+ #
117117+ # %f
118118+ # Name of the current file. Unlike %p, if the file is located on a non-local
119119+ # virtual filesystem, that is either tarfs or ftpfs, then the file will be
120120+ # temporarily copied into a local directory and %f will be the full path
121121+ # to this local temporary file.
122122+ # If you don't want to get a local copy and want to get the virtual fs path
123123+ # (like /ftp://ftp.cvut.cz/pub/hungry/xword), then use %d/%p instead of %f.
124124+ # Also provided to the external application as MC_EXT_FILENAME environment variable.
125125+ #
126126+ # %d
127127+ # Name of the current directory without the trailing slash (`pwd`).
128128+ # Also provided to the external application as MC_EXT_CURRENTDIR environment variable.
129129+ #
130130+ # %s
131131+ # "Selected files", that is space separated list of tagged files if any or the name
132132+ # of the current file.
133133+ # Also provided to the external application as MC_EXT_SELECTED environment variable.
134134+ #
135135+ # %t
136136+ # List of the tagged files.
137137+ # Also provided to the external application as MC_EXT_ONLYTAGGED environment variable.
138138+ #
139139+ # %u
140140+ # List of the tagged files (they will be untaged after the command is executed).
141141+ #
142142+ # (If the letter following the % is uppercase, then it refers to the opposite panel.
143143+ # But you shouldn't have to use it in this file.)
144144+ #
145145+ # %cd
146146+ # The rest is a path mc should change into (cd won't work, since it's a child process).
147147+ # %cd handles even vfs names.
148148+ #
149149+ # %view
150150+ # The command output will be piped into mc's internal file viewer. If you use
151151+ # only %view and no command, the viewer will load %f file instead (that is no piping,
152152+ # which is the difference to %view cat %f).
153153+ #
154154+ # %view may be directly followed by {} with one or more of the following
155155+ # separated by commas:
156156+ # ascii (ascii mode)
157157+ # hex (hex mode),
158158+ # nroff (color highlighting for text using escape sequences),
159159+ # unform (no highlighting for nroff sequences)
160160+ #
161161+ # %var{VAR:default}
162162+ # This macro will expand to the value of the VAR variable in the environment if it's
163163+ # set, otherwise the default value will be used. This is similar to the Bourne shell
164164+ # ''${VAR-default} construct.
165165+ #
166166+ # Section can contain both Type and Regex or Type and Shell keys. In this case
167167+ # they are handled as an AND condition.
168168+ #
169169+ # Example:
170170+ # Shell=.3gp
171171+ # Type=^ISO Media.*3GPP
172172+ #
173173+ # matches *.3gp files for which `file` output is a line starting with "ISO Media"
174174+ # and containing "3GPP".
175175+ #
176176+ # If there are more than one keys with the same name in a section, the last key will be used.
177177+ #
178178+ #
179179+ # Any new entries you want to add are always welcome if they are useful on more than one
180180+ # system. You can post your modifications as tickets at www.midnight-commander.org.
181181+182182+183183+ ### Changes ###
184184+ #
185185+ # Reorganization: 2012-03-07 Slava Zanko <slavazanko@gmail.com>
186186+ # 2021-03-28 Andrew Borodin <aborodin@vmail.ru>
187187+ # 2021-08-24 Tomas Szepe <szepe@pinerecords.com>
188188+ # 2022-09-11 Andrew Borodin <aborodin@vmail.ru>: port to INI format.
189189+190190+ [mc.ext.ini]
191191+ Version=4.0
192192+ # gitfs changeset
193193+ regex/^\[git\]
194194+ Open=%cd %p/changesetfs://
195195+ View=%cd %p/patchsetfs://
196196+197197+ ######### Default #########
318198319199 # Default target for anything not described above
320320- default/*
321321- Open=vim %f
322322- View=vim %f
323323-200200+ [Default]
201201+ Open=xdg-open
202202+ View=xdg-open
324203 '';
325204326205in {