home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 January / CHIPCD1_98.iso / software / pelne / monkey / mlinux06.a02 / USR / LIB / MC / MC.EXT < prev    next >
Text File  |  1996-05-24  |  10KB  |  370 lines

  1. # Midnight Commander 3.0 extension file
  2. # Warning: Structure of this file has changed completely with version 3.0
  3. #
  4. # All lines starting with # or empty lines are thrown away.
  5. # Lines starting in the first column should have following format:
  6. #
  7. # keyword/descNL, i.e. everything after keyword/ until new line is desc
  8. #
  9. # keyword can be: 
  10. #
  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)
  14. #    regex (desc is a regular expression)
  15. #          Please note that we are using the GNU regex library and thus
  16. #          \| matches the literal | and | has special meaning (or) and
  17. #          () have special meaning and \( \) are standing for literal ( ).
  18. #    type  (file matches this if `file %f` matches regular expression desc
  19. #          (the filename: part from `file %f` is removed))
  20. #    directory (matches any directory matching regular expression desc)
  21. #    default (matches any file no matter what desc is)
  22. #
  23. # Other lines should start with a space or tab and should be of the format:
  24. #
  25. # keyword=commandNL (with no spaces around =), where keyword should be: 
  26. #
  27. #    Open (if the user presses Enter or doubleclicks it), 
  28. #
  29. #    View (F3), Edit (F4), Drop (user drops some files on it) or any other
  30. #
  31. #    user defined name (those will be listed in the extension dependent pop-up
  32. #    menu). 
  33. #
  34. #    Icon name is name of the corresponding icon (XPM). If it has no path,
  35. #    the default path for mc icons /usr/lib/mc/icons is assumed.
  36. #
  37. #    Title is the default icon title for objects. %p is expanded into the
  38. #    name of that file and %d/%p to a name with full path. Default title
  39. #    (if none is specified) is %p
  40. #
  41. # command is any one-line shell command, with the following substitutions:
  42. #
  43. # %% -> % character
  44. # %p -> name of the current file (without path, but pwd is its path)
  45. # %f -> name of the current file. Unlike %p, if file is located on a 
  46. #    non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
  47. #    then the file will be temporarily copied into a local directory
  48. #    and %f will be the full path to this local temporal file.
  49. #    If you don't want to get a local copy and want to get the
  50. #    virtual fs path (like ftp://ftp.cvut.cz/pub/hungry/xword), then
  51. #    use %d/%p instead of %f.
  52. # %d -> name of the current directory (pwd, without trailing slash)
  53. # %s -> "selected files", i.e. space separated list of tagged files if any
  54. #       or name of the current file
  55. # %t -> list of tagged files
  56. # %u -> list of tagged files (they'll be untaged after the command)
  57. #
  58. # (If these 6 letters are in uppercase, they refer to the other panel.
  59. # But you shouldn't have to use it in this file.)
  60. #
  61. #
  62. # %cd -> the rest is not command, but a path which will mc cd internally
  63. #       into (cd wouldn't work, since it is a child process, and %cd handles 
  64. #       even the vfs names (e.g. tar:archive.tar/path or
  65. #       ftp://tsx-11.mit.edu/
  66. #
  67. # %view -> the command you type will be piped into mc's internal file viewer
  68. #    if you type only the %view and no command, viewer will load %f file
  69. #    instead (i.e. no piping, so it is different to %view cat %f)
  70. #    %view may be directly followed by {} with a list of any of
  71. #    ascii (Ascii mode), hex (Hex mode), nroff (c\bc color highlighting)
  72. #    and unformatted (not highlighting nroff sequences) separated by
  73. #    spaces.
  74. #
  75. # %var -> You use it like this: %var{ENV-VAR:default}.  This macro will expand
  76. #       to the value of the ENV-VAR variable in the environement if it is set
  77. #       otherwise the value in default will be used.  This is similar to
  78. #       the Bourne shell ${VAR-def} construct.  We use it so that the extension
  79. #       file could be used unchanged under some shells that may use different
  80. #       methods of doing this
  81. #
  82. # %q -> will be replaced with a list of files user dropped on it
  83. #    with full pathnames (only applicable in the Drop command).
  84. #
  85. # Target are evaluted from top to bottom (order is thus important).
  86. # If some actions are missing, search continues as if this target didn't
  87. # match (i.e. if a file matches the first and second entry and View action
  88. # is missing in the first one, then on pressing F3 the View action from
  89. # the second entry will be used. default should catch all the actions.
  90. #
  91. # Any handy entries you develop for you are always welcome, if it has
  92. # wider usage than on one system. You can send your modifications to
  93. # via email to mc-devel@roxanne.nuclecu.unam.mx
  94.  
  95. # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
  96.  
  97. regex/\.t([gp]?z|ar\.g?[zZ])$
  98.     Open=%cd tar:%d/%p/
  99.     View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
  100.     Extract=gzip -dc %f 2>/dev/null | tar xf -
  101.     Icon=compressed.xpm
  102.  
  103. # .tar
  104. shell/.tar
  105.     Open=%cd tar:%d/%p/
  106.     View=%view{ascii} tar tvvf %f
  107.     Extract=tar xf %f
  108.     Icon=tar.xpm
  109.  
  110. # Programs
  111. shell/rm
  112.     Open=if test ! -d ~/.trash; then mkdir ~/.trash; fi; I=%{Enter file to be safely deleted}; if test -n "$I"; then mv -f -b -V numbered %q ~/.trash; fi
  113.     Icon=rubbish.xpm
  114.     Drop=if test ! -d ~/.trash; then mkdir ~/.trash; fi; mv -f -b -V numbered %q ~/.trash
  115.     Flush=rm -rf ~/.trash
  116.     Title=Safe delete
  117.  
  118. shell/lpr
  119.     Open=lpr %{Enter file(s) to print}
  120.     Icon=printer.xpm
  121.     Drop=lpr %q
  122.     Print=lpr %{Enter file(s) to print}
  123.  
  124. shell/gzip
  125.     Open=gzip %{Enter file to gzip}
  126.     Icon=compressed.xpm
  127.     Drop=gzip %q
  128.  
  129. shell/gunzip
  130.     Open=gunzip %{Enter file to gunzip}
  131.     Icon=compressed.xpm
  132.     Drop=gunzip %q
  133.  
  134. shell/gdb
  135.     Open=gdb
  136.     Icon=bug.xpm
  137.     Drop=gdb %q
  138.  
  139. # a directory
  140. directory/^..$
  141.     Icon=parent_dir.xpm
  142. directory/^News$
  143.     Icon=news_dir.xpm
  144. directory/^Mail$
  145.     Icon=mail_dir.xpm
  146. directory/^\..*$
  147.     Icon=hidden_dir.xpm
  148. directory/^.*$
  149.     View=%view{ascii,nroff} echo "_D_i_r_e_c_t_o_r_y"; echo %d/%p
  150.     Icon=plain_dir.xpm
  151.  
  152. # ls-lR
  153. regex/^ls-?lR$
  154.     Open=%cd lslR:%d/%p/
  155.     View=%view{ascii}
  156.     Icon=plain_dir.xpm
  157. regex/^ls-?lR\.(g?z|Z)$
  158.     Open=%cd lslR:%d/%p/
  159.     View=%view{ascii} gunzip -c %f
  160.     Icon=plain_dir.xpm
  161.  
  162. # rpm
  163. regex/\.rpm$
  164.     Open=%cd rpm:%d/%p/
  165.  
  166. # zip
  167. regex/\.(zip|ZIP)$
  168.     Open=%cd zip:%d/%p/
  169.     View=%view{ascii} unzip -v %f
  170.     Icon=zip.xpm
  171.     Unzip=unzip %f '*'
  172.  
  173. # zoo
  174. shell/.zoo
  175.     Open=%cd zoo:%d/%p/
  176.     View=%view{ascii} zoo l %f
  177.     Icon=zoo.xpm
  178.     Extract=zoo x %f '*'
  179.  
  180. # lha
  181. regex/\.l(ha|zh)$
  182.     Open=lharc l %f | %var{PAGER:more}
  183.     View=%view{ascii} lharc l %f
  184.     Icon=lharc.xpm
  185.     Extract=lharc x %f '*'
  186.  
  187. # arj
  188. regex/\.a(rj|[0-9][0-9])$
  189.     Open=unarj l %f | %var{PAGER:more}
  190.     View=%view{ascii} unarj l %f
  191.     Icon=zip.xpm
  192.     Unarj=unarj x %f '*'
  193.  
  194. # C
  195. shell/.c
  196.     Open=%var{PAGER:more} %f
  197.     View=%view{ascii}
  198.     Compile=%var{CC:cc} -O -c %f
  199.     Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
  200.     Icon=c.xpm
  201.  
  202. shell/.h
  203.     Open=%var{EDITOR:vi} %f
  204.     Icon=h.xpm
  205.  
  206. shell/.o
  207.     Open=%var{PAGER:more} %f
  208.     Link=%var{CC:cc} -O %f
  209.     Icon=o.xpm
  210.  
  211. shell/.s
  212.     Open=%var{PAGER:more} %f
  213.     Assemble=%var{CC:cc} -O -c %f
  214.     Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
  215.     Icon=s.xpm
  216.  
  217. shell/.dvi
  218.     Open=xdvi %f
  219.     Icon=binary.xpm
  220.  
  221. shell/.tex
  222.     Open=%var{PAGER:more} %f
  223.     TeX=tex %f
  224.     Icon=tex.xpm
  225.  
  226. regex/\.(te?xi)|(texinfo)$
  227.     Icon=tex.xpm
  228.  
  229. # C++
  230. regex/\.(C|cc)$
  231.     Open=%var{PAGER:more} %f
  232.     View=%view{ascii}
  233.     Compile=c++ -O -c %f
  234.     Link=c++ -O -o %d/`basename %f .c` %f
  235.     Icon=cc.xpm
  236.  
  237. # ar library
  238. regex/\.s?a$
  239.     Open=%view{ascii} ar tv %f
  240.     View=%view{ascii} nm %f
  241.     Icon=a.xpm
  242.  
  243. # .so libraries are not manual pages
  244. regex/\.so\.[0-9\.]*$
  245.     View=%view{hex}
  246.     Icon=so.xpm
  247.  
  248. # Manual page
  249. regex/(([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)|\.man)$
  250.     Open=nroff  -Tascii -mandoc %f | %var{PAGER:more}
  251.     View=%view{ascii,nroff} nroff  -Tascii -mandoc %f
  252.     Icon=man.xpm
  253.  
  254. # Troff with me macros.
  255. shell/.me
  256.     Open=nroff  -Tascii -me %f | %var{PAGER:more}
  257.     View=%view{ascii,nroff} nroff  -Tascii -me %f
  258.     Icon=man.xpm
  259.  
  260. # Troff with ms macros.
  261. shell/.ms
  262.     Open=nroff  -Tascii -ms %f | %var{PAGER:more}
  263.     View=%view{ascii,nroff} nroff  -Tascii -ms %f
  264.     Icon=man.xpm
  265.  
  266. # Manual page - compressed
  267. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
  268.     Open=gunzip -dc %f | nroff  -Tascii -mandoc | %var{PAGER:more}
  269.     View=%view{ascii,nroff} gunzip -dc %f | nroff  -Tascii -mandoc
  270.     Icon=man.xpm
  271.  
  272. regex/(read\.?me$)|(README)
  273.     Icon=info.xpm
  274.  
  275. shell/core
  276.     Icon=core.xpm
  277.  
  278. type/PostScript\ text
  279.     Open=ghostview %f
  280.     Icon=postscript.xpm
  281.  
  282. type/GIF\ picture
  283.     Open=xv %f
  284.     Icon=gif.xpm
  285.     
  286. type/JPEG\ picture
  287.     Open=xv %f
  288.     Icon=jpeg.xpm
  289.     
  290. type/TIFF\ file
  291.     Open=xv %f
  292.     Icon=tiff.xpm
  293.     
  294. type/PBM
  295.     Open=xv %f
  296.     Icon=pbm.xpm
  297.     
  298. type/PGM
  299.     Open=xv %f
  300.     Icon=pgm.xpm
  301.     
  302. type/PPM
  303.     Open=xv %f
  304.     Icon=ppm.xpm
  305.     
  306. shell/.xbm
  307.     Open=bitmap %f
  308.     Icon=xbm.xpm
  309.  
  310. shell/.xpm
  311.     Open=xv %f
  312.     View=sxpm %f
  313.     Icon=xpm.xpm
  314.  
  315. # Sound files
  316. shell/.mod
  317.        Open=tracker %f
  318.        Icon=sound.xpm
  319. regex/\.(wav)|(snd)|(voc)|(au)$
  320.        Open=play %f
  321.        Icon=sound.xpm
  322.  
  323. type/FrameMaker
  324.     Open=fmclient -f %f
  325.     Icon=framemaker.xpm
  326.  
  327. type/mail
  328.     Open=elm -f %f
  329.     Icon=mail.xpm
  330.  
  331. # gzipped
  332. type/gzip
  333.     Open=gzip -dc %f | %var{PAGER:more}
  334.     View=%view{ascii} gzip -dc %f 2>/dev/null
  335.     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
  336.     Icon=compressed.xpm
  337.  
  338. # Makefile
  339. regex/[Mm]akefile
  340.     Open=make -f %f %{Enter parameters}
  341.     Icon=makefile.xpm
  342.  
  343. shell/Imakefile
  344.     Open=xmkmf -a
  345.     Icon=makefile.xpm
  346.  
  347. # Executables
  348. type/executable
  349.     Open=./%f
  350.     View=%view
  351.     Drop=./%f %q
  352.     Libraries=%view{ascii} ldd %f
  353.     Icon=application.xpm
  354.  
  355. # HTML
  356. regex/\.html?$
  357. #    Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
  358.     Open=if [ x$DISPLAY = x ]; then lynx %p; else (netscape %p &); fi
  359.     View=%view{ascii} if echo "%d/%p" | grep ^ftp; then lynx -dump %d/%p; else lynx -dump %p; fi
  360.     Icon=html.xpm
  361.  
  362. # Default target for anything not described above
  363. default/*
  364.     Open=
  365.     View=%view{ascii}
  366.     Edit=%var{EDITOR:vi} %f
  367.     Drop=
  368.     Icon=plain.xpm
  369.     Title=%p
  370.