* gcustom-layout.c, gprefs.c: Make the preferences dialog
[midnight-commander.git] / lib / mc-gnome.ext.in
blob6b1440a04eb63635451104067dff6e7b8c355216
1 # Midnight Commander 3.0 extension file
2 # Warning: Structure of this file has changed completely with version 3.0
4 # All lines starting with # or empty lines are thrown away.
5 # Lines starting in the first column should have following format:
7 # keyword/descNL, i.e. everything after keyword/ until new line is desc
9 # keyword can be: 
11 #    shell (desc is, when starting with a dot, any extension (no wildcars), 
12 #          i.e. matches all the files *desc . Example: .tar matches *.tar;
13 #          if it doesn't start with a dot, it matches only a file of that name)
15 #    regex (desc is a regular expression)
16 #          Please note that we are using the GNU regex library and thus
17 #          \| matches the literal | and | has special meaning (or) and
18 #          () have special meaning and \( \) are standing for literal ( ).
20 #    type  (file matches this if `file %f` matches regular expression desc
21 #          (the filename: part from `file %f` is removed))
23 #    directory (matches any directory matching regular expression desc)
25 #    include (matches an include directive)
27 #    default (matches any file no matter what desc is)
29 # Other lines should start with a space or tab and should be of the format:
31 # keyword=commandNL (with no spaces around =), where keyword should be: 
33 #    Open (if the user presses Enter or doubleclicks it), 
35 #    View (F3), Edit (F4), Drop (user drops some files on it) or any other
37 #    user defined name (those will be listed in the extension dependent pop-up
38 #    menu). 
40 #    Title is the default icon title for objects. %p is expanded into the
41 #    name of that file and %d/%p to a name with full path. Default title
42 #    (if none is specified) is %p
44 #    Include is the keyword used to add any further entries from an include/
45 #    section
47 # command is any one-line shell command, with the following substitutions:
49 # %% -> % character
50 # %p -> name of the current file (without path, but pwd is its path)
51 # %f -> name of the current file. Unlike %p, if file is located on a 
52 #       non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
53 #       then the file will be temporarily copied into a local directory
54 #       and %f will be the full path to this local temporal file.
55 #       If you don't want to get a local copy and want to get the
56 #       virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
57 #       use %d/%p instead of %f.
58 # %d -> name of the current directory (pwd, without trailing slash)
59 # %s -> "selected files", i.e. space separated list of tagged files if any
60 #       or name of the current file
61 # %t -> list of tagged files
62 # %u -> list of tagged files (they'll be untaged after the command)
64 # (If these 6 letters are in uppercase, they refer to the other panel.
65 # But you shouldn't have to use it in this file.)
68 # %cd -> the rest is not command, but a path which will mc cd internally
69 #       into (cd wouldn't work, since it is a child process, and %cd handles 
70 #       even the vfs names
72 # %view -> the command you type will be piped into mc's internal file viewer
73 #       if you type only the %view and no command, viewer will load %f file
74 #       instead (i.e. no piping, so it is different to %view cat %f)
75 #       %view may be directly followed by {} with a list of any of
76 #       ascii (Ascii mode), hex (Hex mode), nroff (c\bc color highlighting)
77 #       and unformatted (not highlighting nroff sequences) separated by
78 #       spaces.
80 # %var -> You use it like this: %var{ENV-VAR:default}.  This macro will expand
81 #       to the value of the ENV-VAR variable in the environement if it is set
82 #       otherwise the value in default will be used.  This is similar to
83 #       the Bourne shell ${VAR-def} construct.  We use it so that the extension
84 #       file could be used unchanged under some shells that may use different
85 #       methods of doing this
87 # %q -> will be replaced with a list of files user dropped on it
88 #       with full pathnames (only applicable in the Drop command).
90 # Target are evaluted from top to bottom (order is thus important).
91 # If some actions are missing, search continues as if this target didn't
92 # match (i.e. if a file matches the first and second entry and View action
93 # is missing in the first one, then on pressing F3 the View action from
94 # the second entry will be used. default should catch all the actions.
96 # Any handy entries you develop for you are always welcome, if it has
97 # wider usage than on one system. You can send your modifications to
98 # via email to mc-devel@roxanne.nuclecu.unam.mx
100 # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
102 regex/\.t([gp]?z|ar\.g?[zZ])$
103         Open=%cd %p#utar
104         View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
105         Extract=gzip -dc %f 2>/dev/null | tar xf -
107 regex/\.tar\.bz$
108 #       Open=%cd %p#utar
109         View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
110         Extract=bzip -dc %f 2>/dev/null | tar xf -
112 regex/\.tar\.bz2$
113         Open=%cd %p#utar
114         View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
115         Extract=bzip2 -dc %f 2>/dev/null | tar xf -
117 # .tar
118 shell/.tar
119         Open=%cd %p#utar
120         View=%view{ascii} tar tvvf %f
121         Extract=tar xf %f
123 # bzipped
124 regex/\.bz$
125         Open=bzip -dc %f | %var{PAGER:more}
126         View=%view{ascii} bzip -dc %f 2>/dev/null
127         Uncompress=bunzip %f
129 regex/\.bz2$
130         Open=bzip2 -dc %f | %var{PAGER:more}
131         View=%view{ascii} bzip2 -dc %f 2>/dev/null
132         Uncompress=bunzip2 %f
134 # a directory
135 directory/^.*$
136         Start XTerm here=cd %p; exec xterm &
137         Make tar.gz=I=%{Enter destination file name:}; if test -n "$I"; then tar cvf - %p | gzip > $I; fi
139 # ls-lR
140 regex/^ls-?lR$
141         Open=%cd %p#lslR
142         View=%view{ascii}
144 regex/^ls-?lR\.(g?z|Z)$
145         Open=%cd %p#lslR
146         View=%view{ascii} gunzip -c %f
148 # ftplist
149 regex/\.ftplist$
150         Open=%cd %p#ftplist
152 # rpm
153 regex/\.rpm$
154         Open=%cd %p#rpm
155         Install this RPM=rpm -i %f
156         Upgrade this RPM=rpm -U %f
158 # deb
159 regex/\.deb$
160         Open=%cd %p#deb
161         View=%view{ascii} dpkg-deb -c %f
163 # zip
164 regex/\.(zip|ZIP|jar|JAR)$
165         Open=%cd %p#uzip
166         View=%view{ascii} unzip -v %f
167         Extract=unzip %f
168         Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
169         Unzip=unzip %f '*'
171 # zoo
172 shell/.zoo
173         Open=%cd %p#uzoo
174         View=%view{ascii} zoo l %f
175         Extract=zoo x %f '*'
176         
177 # lha
178 regex/\.(lha|LHA|lzh|LZH)$
179         Open=%cd %p#ulha
180         View=%view{ascii} lharc l %f
181         Extract=lharc x %f '*'
182         Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
184 # arj
185 regex/\.a(rj|[0-9][0-9])$
186         Open=%cd %p#uarj
187         View=%view{ascii} unarj l %f
188         Extract=unarj x %f '*'
189         Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
191 # ar library
192 regex/\.s?a$
193         Open=%cd %p#uar
194         View=%view{ascii} nm %f
196 # C
197 shell/.c
198         Open=gedit %f
199         View=%view{ascii}
200         Compile=%var{CC:cc} -O -c %f
201         Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
203 shell/.f
204         Open=gedit %f
205         View=%view{ascii}
206         Compile=f77 -O -c %f
207         Compile and Link=f77 -O %f
208         
209 shell/.h
210         Open=gedit %f
212 shell/.o
213         Open=%view{hex} %f
214         Link=%var{CC:cc} -O %f
215         Display object file symbols=%view{ascii} nm %f
216         Disassemble=%view{ascii} objdump -d -r %f
218 shell/.s
219         Open=gedit %f
220         Assemble=%var{CC:cc} -O -c %f
221         Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
223 shell/.dvi
224         Open=xdvi %f
225         View=xdvi %f
226         Convert file to Postscript=dvips %f
228 shell/.tex
229         Open=gedit %f
230         TeX this file=tex %f
231         LaTeX this file=tex %f
233 shell/^RMAIL$
234         Start Emacs on this RMAIL file=emacs %f
235         Open=emacs %f
237 # C++
238 regex/\.(C|cc)$
239         Open=gedit %f
240         View=%view{ascii} %f
241         Compile=c++ -O -c %f
242         Link=c++ -O -o %d/`basename %f .c` %f
244 # ar library
245 regex/\.s?a$
246         Open=%view{ascii} ar tv %f
247         View=%view{ascii} nm %f
249 # .so libraries are not manual pages
250 regex/\.so\.[0-9\.]*$
251         View=%view{hex}
253 # Manual page
254 regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
255         Open=gedit %f
256         View=%view{ascii,nroff} nroff @TROFFASCII@ @MANDOC@ %f
258 # Troff with me macros.
259 shell/.me
260         Open=gedit %f
261         View=%view{ascii,nroff} nroff @TROFFASCII@ -me %f
263 # Troff with ms macros.
264 shell/.ms
265         Open=gedit %f
266         View=%view{ascii,nroff} nroff @TROFFASCII@ -ms %f
268 # Manual page - compressed
269 regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
270         Open=%view{ascii,nroff} gunzip -dc %f | nroff @TROFFASCII@ @MANDOC@
271         View=%view{ascii,nroff} gunzip -dc %f | nroff @TROFFASCII@ @MANDOC@
273 type/PostScript
274         Open=gv %f
275         View with GhostView=gv %f
277 type/GIF\ image
278         Open=ee %f
279         Include=image-options
280         
281 type/GIF\ picture
282         Open=ee %f
283         Include=image-options
284         
285 type/JPEG\ picture
286         Open=ee %f
287         Include=image-options
289 type/PC\ bitmap
290         Open=ee %f
291         Include=image-options
293 type/PNG\ image
294         Open=ee %f
295         Include=image-options
297 type/JPEG\ image
298         Open=ee %f
299         Include=image-options
300         
301 type/TIFF\ file
302         Open=ee %f
303         Include=image-options
304         
305 type/PBM
306         Open=ee %f
307         Include=image-options
308         
309 type/PGM
310         Open=ee %f
311         Include=image-options
312         
313 type/PPM
314         Open=ee %f
315         Include=image-options
317 shell/.xbm
318         Open=bitmap %f
320 shell/.xpm
321         Open=ee %f
322         View=sxpm %f
323         Include=image-options
325 include/image-options
326         Set root window to this image=background-properties --setwallpaper %f &
327         Display this file=ee %f &
329 # Sound files
330 shell/.mod
331        Open=tracker %f
333 regex/\.(wav)|(snd)|(voc)|(au)$
334        Open=play %f
336 type/FrameMaker
337         Open=fmclient -f %f
339 type/mail
340         Open=elm -f %f
341         View=%view{ascii} mcmfmt < %f
343 # gzipped
344 type/gzip
345         Open=%view{ascii} gzip -dc %f 2>/dev/null
346         View=%view{ascii} gzip -dc %f 2>/dev/null
347         Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
348         Uncompress=gunzip %f
350 type/compress
351         Open=%view{ascii} gzip -dc %f 2>/dev/null
352         View=%view{ascii} gzip -dc %f 2>/dev/null
353         Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
355 # Makefile
356 regex/[Mm]akefile
357         Open=make -f %f %{Enter parameters}
359 shell/Imakefile
360         Open=xmkmf -a
362 type/PDF
363         Open=xpdf %f
365 # Executables
366 type/executable
367         Open=./%f
368         View=%view
369         Drop=%f %q
370         Execute in XTerm=xterm -e %f &
371         View Required Libraries=%view{ascii} ldd %f
372         Strip binary=strip %f
374 # MPegs
375 regex/\.mpe?g$
376         Open=mpeg_play %f &
377         View (big)=mpeg_play -dither 2x2 %f &
378         View (gray)=mpeg_play -dither gray %f &
380 # HTML
381 regex/\.html?$
382 #       Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
383         Open=gnome-moz-remote %f
384         View=%view{ascii} lynx -dump -force_html %f; 
385         Run with AppletViewer=appletviewer %f
386         View with @X11_WWW@=@X11_WWW@ file://%f
388 # rar
389 regex/\.[rR]([aA][rR]|[0-9][0-9])$
390         Open=%cd %p#urar
391         View=%view{ascii} rar v -c- %f
392         Extract=rar x -c- %f '*'
393         Extract (with flags)=I=%{Enter any RAR flags:}; if test -n "$I";then rar x $I %f; fi
395 # dbf
396 regex/\.(dbf|DBF)$
397        Open=%view{ascii} dbview %f
398        View=%view{ascii} dbview -b %f
400 # wav
401 regex/\.(wav|WAV)$
402        Open=vplay %f
404 # wav22
405 regex/\.(wav22|WAV22)$
406        Open=vplay -s 22 %f
408 # REXX script
409 regex/\.(rexx)|(rex)|(cmd)$
410        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
412 # Microsoft Word Document
413 regex/\.(doc|DOC)$
414 #       View=%view{ascii} catdoc -w %f
415        View=%view{ascii} word2x -f text %f -
416 type/Microsoft Word Document
417 #       View=%view{ascii} catdoc -w %f
418        View=%view{ascii} word2x -f text %f -
420 # cpio rules
422 shell/.cpio.Z
423         Open=%cd %d/%p#ucpio/
424         View=%view{ascii} compress -dc '%f' | cpio -ictv
425         Extract=compress -dc '%f' | cpio -ic
427 shell/.cpio.gz
428         Open=%cd %d/%p#ucpio/
429         View=%view{ascii} gzip -dc '%f' | cpio -ictv
430         Extract=gzip -dc '%f' | cpio -ic
432 shell/.cpio
433         Open=%cd %d/%p#ucpio/
434         View=%view{ascii} cat '%f' | cpio -ictv
435         Extract=cat '%f' | cpio -ic
437 shell/.mp3
438         Open=mpg123 %f
439         View=mpg123 %f
441 # Default target for anything not described above
442 default/*
443         Open=
444         View=%view{ascii}
445         Drop=
446         Title=%p