mc.ext.in 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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. #
  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 ( ).
  19. #
  20. # type (file matches this if `file %f` matches regular expression desc
  21. # (the filename: part from `file %f` is removed))
  22. #
  23. # directory (matches any directory matching regular expression desc)
  24. #
  25. # include (matches an include directive)
  26. #
  27. # default (matches any file no matter what desc is)
  28. #
  29. # Other lines should start with a space or tab and should be of the format:
  30. #
  31. # keyword=commandNL (with no spaces around =), where keyword should be:
  32. #
  33. # Open (if the user presses Enter or doubleclicks it),
  34. #
  35. # View (F3), Edit (F4), Drop (user drops some files on it) or any other
  36. #
  37. # user defined name (those will be listed in the extension dependent pop-up
  38. # menu).
  39. #
  40. # Icon name is name of the corresponding icon (XPM). If it has no path,
  41. # the default path for mc icons @prefix@/lib/mc/icons is assumed.
  42. #
  43. # Title is the default icon title for objects. %p is expanded into the
  44. # name of that file and %d/%p to a name with full path. Default title
  45. # (if none is specified) is %p
  46. #
  47. # Include is the keyword used to add any further entries from an include/
  48. # section
  49. #
  50. # command is any one-line shell command, with the following substitutions:
  51. #
  52. # %% -> % character
  53. # %p -> name of the current file (without path, but pwd is its path)
  54. # %f -> name of the current file. Unlike %p, if file is located on a
  55. # non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
  56. # then the file will be temporarily copied into a local directory
  57. # and %f will be the full path to this local temporal file.
  58. # If you don't want to get a local copy and want to get the
  59. # virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
  60. # use %d/%p instead of %f.
  61. # %d -> name of the current directory (pwd, without trailing slash)
  62. # %s -> "selected files", i.e. space separated list of tagged files if any
  63. # or name of the current file
  64. # %t -> list of tagged files
  65. # %u -> list of tagged files (they'll be untaged after the command)
  66. #
  67. # (If these 6 letters are in uppercase, they refer to the other panel.
  68. # But you shouldn't have to use it in this file.)
  69. #
  70. #
  71. # %cd -> the rest is not command, but a path which will mc cd internally
  72. # into (cd wouldn't work, since it is a child process, and %cd handles
  73. # even the vfs names
  74. #
  75. # %view -> the command you type will be piped into mc's internal file viewer
  76. # if you type only the %view and no command, viewer will load %f file
  77. # instead (i.e. no piping, so it is different to %view cat %f)
  78. # %view may be directly followed by {} with a list of any of
  79. # ascii (Ascii mode), hex (Hex mode), nroff (c\bc color highlighting)
  80. # and unformatted (not highlighting nroff sequences) separated by
  81. # spaces.
  82. #
  83. # %var -> You use it like this: %var{ENV-VAR:default}. This macro will expand
  84. # to the value of the ENV-VAR variable in the environement if it is set
  85. # otherwise the value in default will be used. This is similar to
  86. # the Bourne shell ${VAR-def} construct. We use it so that the extension
  87. # file could be used unchanged under some shells that may use different
  88. # methods of doing this
  89. #
  90. # %q -> will be replaced with a list of files user dropped on it
  91. # with full pathnames (only applicable in the Drop command).
  92. #
  93. # Target are evaluted from top to bottom (order is thus important).
  94. # If some actions are missing, search continues as if this target didn't
  95. # match (i.e. if a file matches the first and second entry and View action
  96. # is missing in the first one, then on pressing F3 the View action from
  97. # the second entry will be used. default should catch all the actions.
  98. #
  99. # Any handy entries you develop for you are always welcome, if it has
  100. # wider usage than on one system. You can send your modifications to
  101. # via email to mc-devel@roxanne.nuclecu.unam.mx
  102. # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
  103. regex/\.t([gp]?z|ar\.g?[zZ])$
  104. Open=%cd %p#utar
  105. View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
  106. Extract=gzip -dc %f 2>/dev/null | tar xf -
  107. Icon=compressed.xpm
  108. regex/\.tar\.bz$
  109. # Open=%cd %p#utar
  110. View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
  111. Extract=bzip -dc %f 2>/dev/null | tar xf -
  112. Icon=compressed.xpm
  113. regex/\.tar\.bz2$
  114. Open=%cd %p#utar
  115. View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
  116. Extract=bzip2 -dc %f 2>/dev/null | tar xf -
  117. Icon=compressed.xpm
  118. # .tar
  119. shell/.tar
  120. Open=%cd %p#utar
  121. View=%view{ascii} tar tvvf %f
  122. Extract=tar xf %f
  123. Icon=tar.xpm
  124. # Programs
  125. shell/rm
  126. 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
  127. Icon=rubbish.xpm
  128. Drop=if test ! -d ~/.trash; then mkdir ~/.trash; fi; mv -f -b -V numbered %q ~/.trash
  129. Flush=rm -rf ~/.trash
  130. Title=Safe delete
  131. shell/lpr
  132. Open=lpr %{Enter file(s) to print}
  133. Icon=printer.xpm
  134. Drop=lpr %q
  135. Print=lpr %{Enter file(s) to print}
  136. shell/gzip
  137. Open=gzip %{Enter file to gzip}
  138. Icon=compressed.xpm
  139. Drop=gzip %q
  140. shell/bzip
  141. Open=bzip %{Enter file to bzip}
  142. Icon=compressed.xpm
  143. Drop=bzip %q
  144. shell/bzip2
  145. Open=bzip2 %{Enter file to bzip}
  146. Icon=compressed.xpm
  147. Drop=bzip2 %q
  148. shell/gunzip
  149. Open=gunzip %{Enter file to gunzip}
  150. Icon=compressed.xpm
  151. Drop=gunzip %q
  152. shell/bunzip
  153. Open=bunzip %{Enter file to bunzip}
  154. Icon=compressed.xpm
  155. Drop=bunzip %q
  156. shell/bunzip2
  157. Open=bunzip2 %{Enter file to bunzip}
  158. Icon=compressed.xpm
  159. Drop=bunzip2 %q
  160. shell/gdb
  161. Open=gdb
  162. Icon=bug.xpm
  163. Drop=gdb %q
  164. # a directory
  165. directory/^\.\.$
  166. Icon=parent_dir.xpm
  167. directory/^News$
  168. Icon=news_dir.xpm
  169. directory/^Mail$
  170. Icon=mail_dir.xpm
  171. directory/^\..*$
  172. Icon=hidden_dir.xpm
  173. directory/^.*$
  174. Start XTerm here=cd %p; exec xterm &
  175. Make tar.gz=I=%{Enter destination file name:}; if test -n "$I"; then tar cvf - %p | gzip > $I; fi
  176. Icon=plain_dir.xpm
  177. # ls-lR
  178. regex/^ls-?lR$
  179. Open=%cd %p#lslR
  180. View=%view{ascii}
  181. Icon=plain_dir.xpm
  182. regex/^ls-?lR\.(g?z|Z)$
  183. Open=%cd %p#lslR
  184. View=%view{ascii} gunzip -c %f
  185. Icon=plain_dir.xpm
  186. # ftplist
  187. regex/\.ftplist$
  188. Open=%cd %p#ftplist
  189. # rpm
  190. regex/\.rpm$
  191. Open=%cd %p#rpm
  192. Install this RPM=rpm -i %f
  193. Upgrade this RPM=rpm -U %f
  194. # deb
  195. regex/\.deb$
  196. Open=%cd %p#deb
  197. View=%view{ascii} dpkg-deb -c %f
  198. # zip
  199. regex/\.(zip|ZIP|jar|JAR)$
  200. Open=%cd %p#uzip
  201. View=%view{ascii} unzip -v %f
  202. Icon=zip.xpm
  203. Extract=unzip %f
  204. Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
  205. Unzip=unzip %f '*'
  206. # zoo
  207. shell/.zoo
  208. Open=%cd %p#uzoo
  209. View=%view{ascii} zoo l %f
  210. Icon=zoo.xpm
  211. Extract=zoo x %f '*'
  212. # lha
  213. regex/\.(lha|LHA|lzh|LZH)$
  214. Open=%cd %p#ulha
  215. View=%view{ascii} lharc l %f
  216. Icon=lharc.xpm
  217. Extract=lharc x %f '*'
  218. Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
  219. # arj
  220. regex/\.a(rj|[0-9][0-9])$
  221. Open=%cd %p#uarj
  222. View=%view{ascii} unarj l %f
  223. Icon=zip.xpm
  224. Extract=unarj x %f '*'
  225. Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
  226. # ha
  227. regex/\.(ha|HA|Ha)$
  228. Open=%cd %p#uha
  229. View=%view{ascii} ha lf %f
  230. Icon=ha.xpm
  231. Extract=ha xy %f '*'
  232. Extract (with flags)=I=%{Enter any HA flags:}; if test -n "$I"; then ha xy $I %f; fi
  233. # ar library
  234. regex/\.s?a$
  235. Open=%cd %p#uar
  236. View=%view{ascii} nm %f
  237. # C
  238. shell/.c
  239. Open=%var{PAGER:more} %f
  240. View=%view{ascii}
  241. Compile=%var{CC:cc} -O -c %f
  242. Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
  243. Icon=c.xpm
  244. shell/.f
  245. Open=%var{PAGER:more} %f
  246. View=%view{ascii}
  247. Compile=f77 -O -c %f
  248. Compile and Link=f77 -O %f
  249. shell/.h
  250. Open=%var{EDITOR:vi} %f
  251. Icon=h.xpm
  252. shell/.o
  253. Open=%var{PAGER:more} %f
  254. Link=%var{CC:cc} -O %f
  255. Icon=o.xpm
  256. Display object file symbols=%view{ascii} nm %f
  257. Disassemble=%view{ascii} objdump -d -r %f
  258. shell/.s
  259. Open=%var{PAGER:more} %f
  260. Assemble=%var{CC:cc} -O -c %f
  261. Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
  262. Icon=s.xpm
  263. shell/.dvi
  264. Open=xdvi %f
  265. Icon=binary.xpm
  266. View=xdvi %f
  267. Convert file to Postscript=dvips %f
  268. shell/.tex
  269. Open=%var{PAGER:more} %f
  270. Icon=tex.xpm
  271. TeX this file=tex %f
  272. LaTeX this file=tex %f
  273. shell/^RMAIL$
  274. Start Emacs on this RMAIL file=emacs %f
  275. Open=emacs %f
  276. regex/\.(te?xi)|(texinfo)$
  277. Icon=tex.xpm
  278. # C++
  279. regex/\.(C|cc)$
  280. Open=%var{PAGER:more} %f
  281. View=%view{ascii}
  282. Compile=c++ -O -c %f
  283. Link=c++ -O -o %d/`basename %f .c` %f
  284. Icon=cc.xpm
  285. # ar library
  286. regex/\.s?a$
  287. Open=%view{ascii} ar tv %f
  288. View=%view{ascii} nm %f
  289. Icon=a.xpm
  290. # .so libraries are not manual pages
  291. regex/\.so\.[0-9\.]*$
  292. View=%view{hex}
  293. Icon=so.xpm
  294. # GNU Info page
  295. type/Info\ text
  296. Open=info --directory %d -f %p
  297. Icon=info.xpm
  298. # Manual page
  299. regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
  300. Open=nroff @TROFFASCII@ @MANDOC@ %f | %var{PAGER:more}
  301. View=%view{ascii,nroff} nroff @TROFFASCII@ @MANDOC@ %f
  302. Icon=man.xpm
  303. # Troff with me macros.
  304. shell/.me
  305. Open=nroff @TROFFASCII@ -me %f | %var{PAGER:more}
  306. View=%view{ascii,nroff} nroff @TROFFASCII@ -me %f
  307. Icon=man.xpm
  308. # Troff with ms macros.
  309. shell/.ms
  310. Open=nroff @TROFFASCII@ -ms %f | %var{PAGER:more}
  311. View=%view{ascii,nroff} nroff @TROFFASCII@ -ms %f
  312. Icon=man.xpm
  313. # Manual page - compressed
  314. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
  315. Open=gzip -dc %f | nroff @TROFFASCII@ @MANDOC@ | %var{PAGER:more}
  316. View=%view{ascii,nroff} gzip -dc %f | nroff @TROFFASCII@ @MANDOC@
  317. Icon=man.xpm
  318. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz$
  319. Open=bzip -dc %f | nroff @TROFFASCII@ @MANDOC@ | %var{PAGER:more}
  320. View=%view{ascii,nroff} bzip -dc %f | nroff @TROFFASCII@ @MANDOC@
  321. Icon=man.xpm
  322. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz2$
  323. Open=bzip2 -dc %f | nroff @TROFFASCII@ @MANDOC@ | %var{PAGER:more}
  324. View=%view{ascii,nroff} bzip2 -dc %f | nroff @TROFFASCII@ @MANDOC@
  325. Icon=man.xpm
  326. regex/(read\.?me$)|(README)
  327. Icon=info.xpm
  328. shell/core
  329. Icon=core.xpm
  330. type/PostScript
  331. Open=gv %f
  332. Icon=postscript.xpm
  333. View with GhostView=gv %f
  334. type/GIF\ image
  335. Open=ee %f
  336. Icon=gif.xpm
  337. Include=image-options
  338. type/GIF\ picture
  339. Open=ee %f
  340. Icon=gif.xpm
  341. Include=image-options
  342. type/JPEG\ picture
  343. Open=ee %f
  344. Icon=jpeg.xpm
  345. Include=image-options
  346. type/PC\ bitmap
  347. Open=ee %f
  348. Icon=bitmap.xpm
  349. Include=image-options
  350. type/PNG\ image
  351. Open=ee %f
  352. Icon=gif.xpm
  353. Include=image-options
  354. type/JPEG\ image
  355. Open=ee %f
  356. Icon=jpeg.xpm
  357. Include=image-options
  358. type/TIFF\ file
  359. Open=ee %f
  360. Icon=tiff.xpm
  361. Include=image-options
  362. type/PBM
  363. Open=ee %f
  364. Icon=pbm.xpm
  365. Include=image-options
  366. type/PGM
  367. Open=ee %f
  368. Icon=pgm.xpm
  369. Include=image-options
  370. type/PPM
  371. Open=ee %f
  372. Icon=ppm.xpm
  373. Include=image-options
  374. shell/.xbm
  375. Open=bitmap %f
  376. Icon=xbm.xpm
  377. shell/.xpm
  378. Open=ee %f
  379. View=sxpm %f
  380. Include=image-options
  381. Icon=xpm.xpm
  382. include/image-options
  383. Set root window to this image=background-properties --setwallpaper %f &
  384. Display this file=ee %f &
  385. # Sound files
  386. shell/.mod
  387. Open=tracker %f
  388. Icon=sound.xpm
  389. regex/\.(wav)|(snd)|(voc)|(au)$
  390. Open=play %f
  391. Icon=sound.xpm
  392. type/FrameMaker
  393. Open=fmclient -f %f
  394. Icon=framemaker.xpm
  395. type/mail
  396. Open=elm -f %f
  397. Icon=mail.xpm
  398. View=%view{ascii} mcmfmt < %f
  399. # Makefile
  400. regex/[Mm]akefile
  401. Open=make -f %f %{Enter parameters}
  402. Icon=makefile.xpm
  403. shell/Imakefile
  404. Open=xmkmf -a
  405. Icon=makefile.xpm
  406. type/PDF
  407. Open=xpdf %f
  408. # Executables
  409. type/executable
  410. Open=./%f
  411. View=%view
  412. Drop=%f %q
  413. Execute in XTerm=xterm -e %f &
  414. View Required Libraries=%view{ascii} ldd %f
  415. Strip binary=strip %f
  416. Icon=application.xpm
  417. # MPegs
  418. regex/\.mpe?g$
  419. Open=mpeg_play %f &
  420. View (big)=mpeg_play -dither 2x2 %f &
  421. View (gray)=mpeg_play -dither gray %f &
  422. # HTML
  423. regex/\.html?$
  424. # Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
  425. Open=if [ x$DISPLAY = x ]; then lynx -force_html %f; else (@X11_WWW@ %f &); fi
  426. View=%view{ascii} lynx -dump -force_html %f;
  427. Icon=html.xpm
  428. Run with AppletViewer=appletviewer %f
  429. View with @X11_WWW@=@X11_WWW@ file://%f
  430. # rar
  431. regex/\.[rR]([aA][rR]|[0-9][0-9])$
  432. Open=%cd %p#urar
  433. View=%view{ascii} rar v -c- %f
  434. Extract=rar x -c- %f '*'
  435. Extract (with flags)=I=%{Enter any RAR flags:}; if test -n "$I";then rar x $I %f; fi
  436. # dbf
  437. regex/\.(dbf|DBF)$
  438. Open=%view{ascii} dbview %f
  439. View=%view{ascii} dbview -b %f
  440. # wav
  441. regex/\.(wav|WAV)$
  442. Open=vplay %f
  443. Icon=wav.xpm
  444. # wav22
  445. regex/\.(wav22|WAV22)$
  446. Open=vplay -s 22 %f
  447. Icon=wav.xpm
  448. # REXX script
  449. regex/\.(rexx)|(rex)|(cmd)$
  450. Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
  451. Icon=rexx.xpm
  452. # Microsoft Word Document
  453. regex/\.(doc|DOC)$
  454. # View=%view{ascii} catdoc -w %f
  455. View=%view{ascii} word2x -f text %f -
  456. Icon=word.xpm
  457. type/Microsoft Word Document
  458. # View=%view{ascii} catdoc -w %f
  459. View=%view{ascii} word2x -f text %f -
  460. Icon=word.xpm
  461. # cpio rules
  462. shell/.cpio.Z
  463. Open=%cd %d/%p#ucpio/
  464. View=%view{ascii} compress -dc '%f' | cpio -ictv
  465. Extract=compress -dc '%f' | cpio -ic
  466. Icon=compressed.xpm
  467. shell/.cpio.gz
  468. Open=%cd %d/%p#ucpio/
  469. View=%view{ascii} gzip -dc '%f' | cpio -ictv
  470. Extract=gzip -dc '%f' | cpio -ic
  471. Icon=compressed.xpm
  472. shell/.cpio
  473. Open=%cd %d/%p#ucpio/
  474. View=%view{ascii} cat '%f' | cpio -ictv
  475. Extract=cat '%f' | cpio -ic
  476. Icon=cpio.xpm
  477. shell/.mp3
  478. Open=mpg123 %f
  479. View=mpg123 %f
  480. Icon=sound.xpm
  481. regex/\.trpm$
  482. Open=%cd trpm:%p
  483. View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
  484. # gzipped
  485. type/gzip
  486. Open=gzip -dc %f | %var{PAGER:more}
  487. View=%view{ascii} gzip -dc %f 2>/dev/null
  488. 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
  489. Uncompress=gunzip %f
  490. Icon=compressed.xpm
  491. # bzipped
  492. type/bzip2
  493. Open=bzip2 -dc %f | %var{PAGER:more}
  494. View=%view{ascii} bzip2 -dc %f 2>/dev/null
  495. Edit=I=`date +%%s`; export I; bzip2 -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip2 -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
  496. Uncompress=bunzip2 %f
  497. Icon=compressed.xpm
  498. type/bzip
  499. Open=bzip -dc %f | %var{PAGER:more}
  500. View=%view{ascii} bzip -dc %f 2>/dev/null
  501. Edit=I=`date +%%s`; export I; bzip -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
  502. Uncompress=bunzip %f
  503. Icon=compressed.xpm
  504. type/compress
  505. Open=gzip -dc %f | %var{PAGER:more}
  506. View=%view{ascii} gzip -dc %f 2>/dev/null
  507. 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
  508. Icon=compressed.xpm
  509. # Default target for anything not described above
  510. default/*
  511. Open=
  512. View=%view{ascii}
  513. Drop=
  514. Icon=plain.xpm
  515. Title=%p