]> git.phdru.name Git - dotfiles.git/blob - .mc/menu
mc.menu refactoring: create a directory for archive
[dotfiles.git] / .mc / menu
1 shell_patterns=0
2
3 # This is necessary to overcome a bug in mc - without this
4 # mc makes default wrong item
5 :  NOOP
6    :
7
8 @  Do something on all of the file(s) at once
9    CMD=%{Enter command}
10    exec $CMD %s
11
12 + t t
13 @  Do something on the tagged files one by one
14    CMD=%{Enter command}
15    for f in %t; do
16      $CMD "$f"
17    done
18
19 + t r
20 p  View the file in a pager
21    exec ${PAGER:-more} %f
22
23 + t r
24 b  View the file in a browser
25    exec webbrowser file://%d/%f
26
27 + t r
28 w  View the file in a new browser window
29    exec webbrowser -n file://%d/%f
30
31 + t r
32 = f \.(htm(l?)|txt)$
33 t  View the file in a new browser tab
34    exec webbrowser -t file://%d/%f
35
36 += f \.fb2(\.bz2|\.gz|\.zip)?$ | f \.(chm|epub|htm(l?)|txt|rtf)$ & t r
37 f  View fb2/chm/epub with fbreader
38    fbreader %f &
39
40 + t r & f \.fb2(\.bz2|\.gz|\.zip)$
41 H  fb2html
42    case %f in
43      *.fb2.bz2) A="bunzip2 -c" ;;
44      *.fb2.gz) A="gunzip -c" ;;
45      *.fb2.zip) A="unzip -p" ;;
46      *.fb2) A="cat" ;;
47    esac
48    $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_html_ru.xsl - | webstdin -t
49
50 + t r & f \.fb2(\.bz2|\.gz|\.zip)$
51 T  fb2txt
52    case %f in
53      *.fb2.bz2) A="bunzip2 -c" ;;
54      *.fb2.gz) A="gunzip -c" ;;
55      *.fb2.zip) A="unzip -p" ;;
56      *.fb2) A="cat" ;;
57    esac
58    $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_txt_ru.xsl - | webstdin -e txt -t
59
60 += t r & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
61 o  View OpenDoc with odt2txt
62    odt2txt %f | ${PAGER:-more}
63
64 + t r & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
65 e  Edit OpenDoc with libreoffice
66    libreoffice %f &
67
68 += t r & f \.(pdf|PDF|ps|PS|djvu)(\.bz2|\.gz)?$
69 e  View pdf/ps/djvu with evince
70    evince %f &
71
72 += t r & f \.(doc|DOC|rtf)$
73 d  View doc with catdoc
74    catdoc %f | ${PAGER:-more}
75
76 + t r & f \.(doc|DOC|rtf)$
77 e  Edit doc with libreoffice
78    libreoffice %f &
79
80 += t r & f \.(docx|DOCX)$
81 d  View docx with docx2txt
82    docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
83
84 + t r & f \.(docx|DOCX)$
85 e  Edit docx with libreoffice
86    libreoffice %f &
87
88 += t r & f \.(xls|XLS)$
89 x  View xls with xls2csv
90    xls2csv %f | ${PAGER:-more}
91
92 + t r & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
93 = t r & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
94 i  View image(s) scaled
95    xli -title "`echo %s | sed 's/ /_/g'`" -zoom auto %s &
96
97 + t r & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
98 I  View image(s) full size
99    xli -title "`echo %s | sed 's/ /_/g'`" %s &
100
101 + t r & f \.(ico|jp2|tif|TIF|tiff|TIFF)$ | t t
102 = t r & f \.(ico|jp2|tif|TIF|tiff|TIFF)$
103 I  View icon, JPEG-2000 or TIFF image
104    display %s &
105
106 + t r & f \.(aac|ac3|ape|cue|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
107 a  Add the audiofile(s) or playlist(s)
108    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
109    #for f in %s; do
110    #   audtool --playlist-addurl "$f"
111    #done
112    #smplayer -add-to-playlist %s &
113    deadbeef --queue %s &
114
115 + t r & f \.(aac|ac3|ape|cue|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
116 = t r & f \.(aac|ac3|ape|cue|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
117 p  Load the audiofile(s) or playlist(s)
118    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
119    #audtool --playlist-clear
120    #for f in %s; do
121    #   audtool --playlist-addurl "$f"
122    #done
123    #smplayer -send-action pl_remove_all
124    #smplayer -add-to-playlist %s &
125    deadbeef --queue %s &
126
127 + t r & f \.(aac|ac3|ape|cue|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
128 P  Play the audiofile(s) or playlist(s)
129    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
130    #audtool --playlist-clear
131    #for f in %s; do
132    #   audtool --playlist-addurl "$f"
133    #done
134    #exec audtool --playback-play
135    #mplayer -playlist %f &
136    #smplayer %s &
137    deadbeef %s &
138    #exec mediaplayer_open %f
139
140 + t r & f \.m3u
141 R  Play the playlist in random order
142    "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
143    #if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 500 audacious & sleep 3; fi
144    #audtool --playlist-clear
145    #audtool --playlist-addurl random-playlist-tmp.m3u
146    #audtool --playback-play
147    #mplayer -playlist random-playlist-tmp.m3u &
148    #smplayer random-playlist-tmp.m3u &
149    #smplayer -actions pl_shuffle %f &
150    deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
151    #mediaplayer_open random-playlist-tmp.m3u
152    (sleep 5; exec rm random-playlist-tmp.m3u) &
153
154 + f \.(aac|ac3|ape|cue|flac|m3u|mp3|MP3|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|iso|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t d | t t
155 = t r & f \.(aac|ac3|ape|cue|flac|m3u|mp3|MP3|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|iso|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$
156 s  Play audio/video file(s) or directory with smplayer
157    smplayer %s &
158
159 += t d & f (video_ts|VIDEO_TS)$
160 c  Play the current directory with smplayer
161    smplayer . &
162
163 + t r & f \.(m3u|mp3|MP3|cue|aac|ac3|ape|flac|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t t
164 i  Audio/video info
165    exec mplayer -msglevel identify=6 -frames 0 %s
166
167 + t d & f (video_ts|VIDEO_TS)$
168 i  DVD info
169    exec mplayer -dvd-device . dvd:// -msglevel identify=6 -frames 0
170
171 + f \.(avi|AVI|flv|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t t
172 m  Play video file(s) with mplayer
173    mplayer %s &
174
175 + f \.(m3u|mp3|MP3|cue|aac|ac3|ape|flac|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t t
176 M  Play audio/video with gmplayer
177    gmplayer %s &
178
179 + t d & f (video_ts|VIDEO_TS)$
180 d  Play DVD directory with mplayer
181    mplayer -dvd-device . dvd:// &
182
183 + t d & f (video_ts|VIDEO_TS)$
184 D  Play DVD directory with gmplayer
185    gmplayer -dvd-device . dvd:// &
186
187 + t d & f (video_ts|VIDEO_TS)$
188 t  Play DVD title with mplayer
189    title=%{Enter title}
190    mplayer -dvd-device . dvd://"$title" &
191
192 + t d & f (video_ts|VIDEO_TS)$
193 T  Play DVD title with gmplayer
194    title=%{Enter title}
195    gmplayer -dvd-device . dvd://"$title" &
196
197 + t d
198 p  Play directory with mplayer
199    mplayer %f/* &
200
201 + t d
202 P  Play directory with gmplayer
203    gmplayer %f/* &
204
205 + t d & f ^\.\.$
206 b  Compress the current subdirectory to tar.bz2
207    Pwd="`basename %d /`"
208    echo -n "Name of the distribution file (without extension) [$Pwd]: "
209    read tar
210    if [ "$tar"x = x ]; then tar="$Pwd"; fi
211    cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
212    echo ../"$tar".tar.bz2 created.
213
214 + t d & f ^\.\.$
215 g  Compress the current subdirectory to tar.gz
216    Pwd="`basename %d /`"
217    echo -n "Name of the distribution file (without extension) [$Pwd]: "
218    read tar
219    if [ "$tar"x = x ]; then tar="$Pwd"; fi
220    cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
221    echo ../"$tar".tar.gz created.
222
223 + t d & f ^\.\.$
224 t  Compress the current subdirectory to tar
225    Pwd="`basename %d /`"
226    echo -n "Name of the distribution file (without extension) [$Pwd]: "
227    read tar
228    if [ "$tar"x = x ]; then tar="$Pwd"; fi
229    cd .. && tar cvf - "$Pwd" > "$tar".tar &&
230    echo ../"$tar".tar created.
231
232 + t d & f ^\.\.$
233 z  Compress the current subdirectory to zip
234    Pwd="`basename %d /`"
235    echo -n "Name of the distribution file (without extension) [$Pwd]: "
236    read zip
237    if [ "$zip"x = x ]; then zip="$Pwd"; fi
238    cd .. && zip -r9 "$zip".zip "$Pwd" &&
239    echo ../"$zip".zip created.
240
241 + t d & f ^\.\.$
242 y  Compress the current subdirectory to zip with recoded filenames
243    Pwd="`basename %d /`"
244    echo -n "Name of the distribution file (without extension) [$Pwd]: "
245    read zip
246    if [ "$zip"x = x ]; then zip="$Pwd"; fi
247    cd .. && zip.py "$zip".zip "$Pwd" &&
248    echo ../"$zip".zip created.
249
250 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
251 z  bzip2 the file/directory
252    exec bzip2 -9 %f.bz2 %f
253
254 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
255 z  gzip the file/directory
256    exec gzip -9 %f.gz %f
257
258 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
259 z  lzip the file/directory
260    exec lzip -9 %f.lz %f
261
262 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
263 z  lzma the file/directory
264    exec lzma -9 %f.lzma %f
265
266 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
267 z  7z the file/directory
268    exec 7z -9 %f.7z %f
269
270 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
271 z  xz the file/directory
272    exec xz -9 %f.xz %f
273
274 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
275 z  zip the file/directory
276    exec zip -r9 %f.zip %f
277
278 + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$
279 y  zip the file/directory with recoded filename(s)
280    exec zip.py %f.zip %f
281
282 + t t
283 Z  zip these files/directories
284    ZIP=%{Enter zip name}
285    exec zip -r9 "$ZIP" %s
286
287 + t t
288 Y  zip these files/directories with recoded filenames
289    ZIP=%{Enter zip name}
290    exec zip.py "$ZIP" %s
291
292 + t r & f \.tar\.bz2$
293 u  Extract from tar-bzip2
294    exec bzip2 -cd %f | tar xpvf -
295 + F \.tar\.bz2$ | F \.tar\.gz$ | F \.tgz$ | F \.tar\.lz$ | F \.tar\.lzma$ | F \.(zip|ZIP)$ | F \.(rar|RAR)$ | F \.7z$ | F \.xz$ & T r
296 N  Create a directory for the other archive
297    case %D/%F in
298      *.tar.bz2)  D="`basename %F .tar.bz2`";;
299      *.tar.gz)   D="`basename %F .tar.gz`";;
300      *.tgz)      D="`basename %F .tgz`";;
301      *.tar.lz)   D="`basename %F .tar.lz`";;
302      *.tar.lzma) D="`basename %F .tar.lzma`";;
303      *.zip)      D="`basename %F .zip`";;
304      *.ZIP)      D="`basename %F .ZIP`";;
305      *.rar)      D="`basename %F .rar`";;
306      *.RAR)      D="`basename %F .RAR`";;
307      *.7z)       D="`basename %F .7z`";;
308      *.xz)       D="`basename %F .xz`";;
309    esac
310    exec mkdir "$D"
311
312 + f \.tar\.gz$ | f \.tgz$ & t r
313 u  Extract from tar-gzip
314    exec gzip -cd %f | tar xpvf -
315
316 + t r & f \.tar$
317 u  Extract from tar
318    exec tar xpvf %f
319
320 + t r & f \.(zip|ZIP)$
321 u  Extract from zip
322    exec unzip %f
323
324 + t r & f \.(zip|ZIP)$
325 y  Extract from zip with recoded filenames
326    exec unzip.py %f
327
328 + t r & f \.7z$
329 u  Extract from 7zip
330    exec 7zr x %f
331
332 + t r & f \.(rar|RAR)$
333 u  Extract from rar
334    exec unrar x -y %f
335
336 + t r & f \.tar\.xz$
337 u  Extract from tar-xz
338    exec xz -cd %f | tar xpvf -
339
340 + T r & F \.tar\.bz2$
341 U  Extract from the other tar-bzip2
342    exec bzip2 -cd %D/%F | tar xpvf -
343
344 + F \.tar\.gz$ | F \.tgz$ & T r
345 U  Extract from the other tar-gzip
346    exec gzip -cd %D/%F | tar xpvf -
347
348 + T r & F \.tar$
349 U  Extract from the other tar
350    exec tar xpvf %D/%F
351
352 + T r & F \.(zip|ZIP)$
353 U  Extract from the other zip
354    exec unzip %D/%F
355
356 + T r & F \.(zip|ZIP)$
357 Y  Extract from the other zip with recoded filenames
358    exec unzip.py %D/%F
359
360 + T r & F \.(rar|RAR)$
361 U  Extract from the other rar
362    exec unrar x -y %D/%F
363
364 + T r & F \.7z$
365 U  Extract from 7zip
366    exec 7zr x %D/%F
367
368 + T r & F \.tar\.xz$
369 U  Extract from tar-xz
370    exec xz -cd %D/%F | tar xpvf -
371
372 + t r
373 v  View via mailcap
374    exec see %f
375
376 + t r
377 c  Compare the file
378    exec cmp %D/%f %f
379
380 + t r & T r
381 C  Compare these files
382    exec cmp %D/%F %f
383
384 + t r
385 d  Diff the file
386    exec diff -u --speed-large-files %D/%f %f
387
388 + t r & T r
389 D  Diff these files
390    exec diff -u --speed-large-files %D/%F %f
391
392 + t r
393 v  vimdiff the file
394    exec vim -d %D/%f %f
395
396 + t r & T r
397 V  vimdiff these files
398    exec vim -d %D/%F %f
399
400 + t d & ! f ^\.\.$
401 d  Diff the directory
402    exec diff -ru --speed-large-files %D/%f %f
403
404 + t d & T d & ! F ^\.\.$
405 D  Diff these directories
406    exec diff -ru --speed-large-files %D/%F %f
407
408 += f \.(asc|sig(n)?)$ & t r
409 v  Verify signature
410    exec gpg --verify %f
411
412 += f \.[1-8]$ | f \.man$ & t r
413 1  Display the file with roff -man
414    %view nroff -man %f
415
416 m  View a manual page
417    MAN=%{Enter manual name}
418    %view man -P cat $MAN
419
420 + t r | t d | t t
421 r  rsync the file(s) there
422    rsync -ahP --del %s %D