]> git.phdru.name Git - dotfiles.git/blob - .mc/menu
Refactor(.mc/menu): Reorder menu items
[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 selected files one by one
14    CMD=%{Enter command}
15    for f in %s; do
16      $CMD "$f"
17    done
18
19 + t lr
20 p  View the file in a pager
21    exec ${PAGER:-more} %f
22
23 + t lr
24 g  Edit the file in gvim
25    gvim %f &
26
27 + t lr
28 b  View the file in a browser
29    exec webbrowser-encode-url -e utf-8 file://%d/%f
30
31 + t lr
32 = f \.(htm(l?)|txt)$
33 w  View the file in a new browser window
34    exec webbrowser-encode-url -e utf-8 -n file://%d/%f
35
36 + t lr
37 t  View the file in a new browser tab
38    exec webbrowser-encode-url -e utf-8 -t file://%d/%f
39
40 += f \.fb2(\.bz2|\.gz|\.zip)?$ | f \.(chm|epub|htm(l?)|txt|rtf)$ & t lr
41 f  View fb2/chm/epub with fbreader
42    fbreader %f &
43
44 + t lr & f \.fb2(\.bz2|\.gz|\.zip)$
45 H  fb2html
46    case %f in
47      *.fb2.bz2) A="bunzip2 -c" ;;
48      *.fb2.gz) A="gunzip -c" ;;
49      *.fb2.zip) A="unzip -p" ;;
50      *.fb2) A="cat" ;;
51    esac
52    $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_html_ru.xsl - | webstdin -t
53
54 + t lr & f \.fb2(\.bz2|\.gz|\.zip)$
55 T  fb2txt
56    case %f in
57      *.fb2.bz2) A="bunzip2 -c" ;;
58      *.fb2.gz) A="gunzip -c" ;;
59      *.fb2.zip) A="unzip -p" ;;
60      *.fb2) A="cat" ;;
61    esac
62    $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_txt_ru.xsl - | webstdin -e txt -t
63
64 += t lr & f \.(pdf|PDF)$
65 e  View pdf
66    evince %f &
67
68 += t lr & f \.djvu(\.bz2|\.gz)?$
69 e  View djvu
70    djview %f &
71
72 + t lr & f \.((pdf|PDF|ps|PS)(\.bz2|\.gz)?|odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg|doc|DOC|rtf|docx|DOCX|xls|XLS|xlsx|XLSX)$
73 e  Edit (Open)Docs with libreoffice
74    libreoffice %f &
75
76 + t lr & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg|doc|DOC|rtf|docx|DOCX|xls|XLS|xlsx|XLSX)$
77 v  View (Open)Docs with libreoffice
78    #libreoffice --headless --convert-to "txt:Text (encoded):UTF8" %f
79    libreoffice --cat %f | ${PAGER:-more}
80
81 += t lr & f \.(doc|DOC|rtf)$
82 d  View doc with catdoc
83    catdoc %f | ${PAGER:-more}
84
85 += t lr & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
86 o  View OpenDoc with odt2txt
87    odt2txt %f | ${PAGER:-more}
88
89 += t lr & f \.(docx|DOCX)$
90 d  View docx with docx2txt
91    docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
92
93
94 += t lr & f \.(xls|XLS)$
95 x  View xls with xls2csv
96    xls2csv %f | ${PAGER:-more}
97
98 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
99 = t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
100 i  View image(s) scaled
101    xli -title "`echo %s | sed 's/ /_/g'`" -zoom auto %s &
102
103 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
104 I  View image(s) full size
105    xli -title "`echo %s | sed 's/ /_/g'`" %s &
106
107 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
108 I  Identify image
109    xli -identify %f
110
111 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$ | t t
112 = t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
113 I  View icon, JPEG-2000, TIFF, WebP image
114    display %s &
115
116 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
117 a  Add the audiofile(s) or playlist(s)
118    if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
119    for f in %s; do
120       audtool --playlist-addurl "$f"
121    done
122    #deadbeef --queue %s &
123
124 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
125 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
126 p  Load the audiofile(s) or playlist(s)
127    if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
128    audtool --playlist-clear
129    for f in %s; do
130       audtool --playlist-addurl "$f"
131    done
132    #deadbeef --queue %s &
133
134 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
135 P  Play the audiofile(s) or playlist(s)
136    if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
137    audtool --playlist-clear
138    for f in %s; do
139       audtool --playlist-addurl "$f"
140    done
141    exec audtool --playback-play
142    #mplayer -playlist %f &
143    #deadbeef %s &
144
145 + t lr & f \.m3u
146 R  Play the playlist in random order
147    "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
148    if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
149    audtool --playlist-clear
150    audtool --playlist-addurl random-playlist-tmp.m3u
151    audtool --playback-play
152    #mplayer -playlist random-playlist-tmp.m3u &
153    #deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
154    (sleep 5; exec rm random-playlist-tmp.m3u) &
155
156 + t lr & f \.(m3u|mp3|MP3|cue|aac|ac3|ape|dts|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)$
157 i  Audio/video info
158    exec "$HOME"/.config/mpv/mpv_identify.sh %f
159
160 + t d & f (video_ts|VIDEO_TS)$
161 i  DVD info
162    exec "$HOME"/.config/mpv/mpv_identify.sh .
163
164 + f \.(aac|ac3|ape|cue|dts|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
165 m  Play video file(s) with mpv
166    mplayer %s &
167
168 + f \.(aac|ac3|ape|cue|dts|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
169 m  Play video file(s) with mpv (loud)
170    AUDIO_VOLUME=120
171    export AUDIO_VOLUME
172    mplayer %s &
173
174 + f \.(aac|ac3|ape|cue|dts|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
175 = f \.(aac|ac3|ape|cue|dts|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)$
176 m  Play video file(s) with mpv (louder)
177    AUDIO_VOLUME=150
178    export AUDIO_VOLUME
179    mplayer %s &
180
181 + f \.(aac|ac3|ape|cue|dts|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
182 m  Play video file(s) with mpv (ask for volume)
183    AUDIO_VOLUME=%{Enter volume}
184    export AUDIO_VOLUME
185    mplayer %s &
186
187 + f \.(m3u|mp3|MP3|cue|aac|ac3|ape|dts|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
188 M  Play audio/video with mpv GUI
189    gmplayer %s &
190
191 += t d & f (video_ts|VIDEO_TS)$
192 d  Play DVD directory with mpv
193    mplayer -dvd-device . dvd:// &
194
195 + t d & f (video_ts|VIDEO_TS)$
196 D  Play DVD directory with mpv GUI
197    gmplayer -dvd-device . dvd:// &
198
199 + t d & f (video_ts|VIDEO_TS)$
200 t  Play DVD title with mpv
201    title=%{Enter title}
202    mplayer -dvd-device . dvd://"$title" &
203
204 + t d & f (video_ts|VIDEO_TS)$
205 T  Play DVD title with mpv GUI
206    title=%{Enter title}
207    gmplayer -dvd-device . dvd://"$title" &
208
209 + t d
210 p  Play directory with mpv
211    mplayer %f/* &
212
213 + t d
214 P  Play directory with mpv GUI
215    gmplayer %f/* &
216
217 + t d & f ^\.\.$
218 b  Compress the current subdirectory to tar.bz2
219    Pwd="`basename %d /`"
220    echo -n "Name of the distribution file (without extension) [$Pwd]: "
221    read tar
222    if [ "$tar"x = x ]; then tar="$Pwd"; fi
223    cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
224    echo ../"$tar".tar.bz2 created.
225
226 + t d & f ^\.\.$
227 g  Compress the current subdirectory to tar.gz
228    Pwd="`basename %d /`"
229    echo -n "Name of the distribution file (without extension) [$Pwd]: "
230    read tar
231    if [ "$tar"x = x ]; then tar="$Pwd"; fi
232    cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
233    echo ../"$tar".tar.gz created.
234
235 + t d & f ^\.\.$
236 l  Compress the current subdirectory to tar.lzma
237    Pwd="`basename %d /`"
238    echo -n "Name of the distribution file (without extension) [$Pwd]: "
239    read tar
240    if [ "$tar"x = x ]; then tar="$Pwd"; fi
241    cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
242    echo ../"$tar".tar.lzma created.
243
244 + t d & f ^\.\.$
245 x  Compress the current subdirectory to tar.xz
246    Pwd="`basename %d /`"
247    echo -n "Name of the distribution file (without extension) [$Pwd]: "
248    read tar
249    if [ "$tar"x = x ]; then tar="$Pwd"; fi
250    cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
251    echo ../"$tar".tar.xz created.
252
253 + t d & f ^\.\.$
254 t  Compress the current subdirectory to tar
255    Pwd="`basename %d /`"
256    echo -n "Name of the distribution file (without extension) [$Pwd]: "
257    read tar
258    if [ "$tar"x = x ]; then tar="$Pwd"; fi
259    cd .. && tar cvf - "$Pwd" > "$tar".tar &&
260    echo ../"$tar".tar created.
261
262 + t d & f ^\.\.$
263 z  Compress the current subdirectory to zip
264    Pwd="`basename %d /`"
265    echo -n "Name of the distribution file (without extension) [$Pwd]: "
266    read zip
267    if [ "$zip"x = x ]; then zip="$Pwd"; fi
268    cd .. && zip -r9 "$zip".zip "$Pwd" &&
269    echo ../"$zip".zip created.
270
271 + t d & f ^\.\.$
272 y  Compress the current subdirectory to zip recoding filenames
273    Pwd="`basename %d /`"
274    echo -n "Name of the distribution file (without extension) [$Pwd]: "
275    read zip
276    if [ "$zip"x = x ]; then zip="$Pwd"; fi
277    cd .. && zip.py "$zip".zip "$Pwd" &&
278    echo ../"$zip".zip created.
279
280 + t d & f ^\.\.$
281 7  Compress the current subdirectory to 7z
282    Pwd="`basename %d /`"
283    echo -n "Name of the distribution file (without extension) [$Pwd]: "
284    read ar
285    if [ "$ar"x = x ]; then ar="$Pwd"; fi
286    cd .. && 7zr a "$ar".7z "$Pwd" &&
287    echo ../"$ar".7z created.
288
289 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
290 z  bzip2 the file
291    exec bzip2 -9 %f
292
293 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
294 z  gzip the file
295    exec gzip -9 %f
296
297 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
298 z  lzip the file
299    exec lzip -9 %f
300
301 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
302 z  lzma the file
303    exec lzma -9 %f
304
305 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
306 z  7z the file/directory
307    exec 7zr a %f.7z %f
308
309 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
310 z  xz the file
311    exec xz -9 %f
312
313 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
314 z  zip the file/directory
315    exec zip -r9 %f.zip %f
316
317 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
318 y  zip the file/directory recoding filename(s)
319    exec zip.py %f.zip %f
320
321 + t t
322 Z  zip selected files/directories
323    ZIP=%{Enter zip name}
324    exec zip -r9 "$ZIP" %s
325
326 + t t
327 Y  zip selected files/directories recoding filenames
328    ZIP=%{Enter zip name}
329    exec zip.py "$ZIP" %s
330
331 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
332 n  Create a directory for this archive
333    case %f in
334      *.tar.Z)    D="`basename %f .tar.Z`";;
335      *.tar.bz2)  D="`basename %f .tar.bz2`";;
336      *.tar.gz)   D="`basename %f .tar.gz`";;
337      *.tbz2)     D="`basename %f .tbz2`";;
338      *.tgz)      D="`basename %f .tgz`";;
339      *.tz)       D="`basename %f .tz`";;
340      *.tar.lz)   D="`basename %f .tar.lz`";;
341      *.tar.lzma) D="`basename %f .tar.lzma`";;
342      *.tar.7z)   D="`basename %f .tar.7z`";;
343      *.zip)      D="`basename %f .zip`";;
344      *.ZIP)      D="`basename %f .ZIP`";;
345      *.rar)      D="`basename %f .rar`";;
346      *.RAR)      D="`basename %f .RAR`";;
347      *.xz)       D="`basename %f .xz`";;
348      *.7z)       D="`basename %f .7z`";;
349    esac
350    exec mkdir "$D"
351
352 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
353 N  Create a directory for the other archive
354    case %D/%F in
355      *.tar.Z)    D="`basename %F .tar.Z`";;
356      *.tar.bz2)  D="`basename %F .tar.bz2`";;
357      *.tar.gz)   D="`basename %F .tar.gz`";;
358      *.tbz2)     D="`basename %F .tbz2`";;
359      *.tgz)      D="`basename %F .tgz`";;
360      *.tz)       D="`basename %F .tz`";;
361      *.tar.lz)   D="`basename %F .tar.lz`";;
362      *.tar.lzma) D="`basename %F .tar.lzma`";;
363      *.tar.7z)   D="`basename %F .tar.7z`";;
364      *.zip)      D="`basename %F .zip`";;
365      *.ZIP)      D="`basename %F .ZIP`";;
366      *.rar)      D="`basename %F .rar`";;
367      *.RAR)      D="`basename %F .RAR`";;
368      *.xz)       D="`basename %F .xz`";;
369      *.7z)       D="`basename %F .7z`";;
370    esac
371    exec mkdir "$D"
372
373 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
374 x  Extract the contents of a compressed tar file
375    unset PRG
376    case %f in
377       *.tar.bz2|*.tbz2)
378          PRG="bunzip2 -c"
379       ;;
380       *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
381          PRG="gzip -dc"
382       ;;
383       *.tar.lz)
384          PRG="lzip -dc"
385       ;;
386       *.tar.lzma)
387          PRG="lzma -dc"
388       ;;
389       *.tar.7z)
390          PRG="7zr e -so"
391       ;;
392       *.tar.xz)
393          PRG="xz -dc"
394       ;;
395       *)
396       exit 1
397       ;;
398    esac
399    $PRG %f | tar xvpf -
400
401 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
402 X  Extract the contents of an other compressed tar file
403    unset PRG
404    case %F in
405       *.tar.bz2|*.tbz2)
406          PRG="bunzip2 -c"
407       ;;
408       *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
409          PRG="gzip -dc"
410       ;;
411       *.tar.lz)
412          PRG="lzip -dc"
413       ;;
414       *.tar.lzma)
415          PRG="lzma -dc"
416       ;;
417       *.tar.7z)
418          PRG="7zr e -so"
419       ;;
420       *.tar.xz)
421          PRG="xz -dc"
422       ;;
423       *)
424       exit 1
425       ;;
426    esac
427    $PRG %D/%F | tar xvpf -
428
429 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
430 x  Extract a compressed file
431    case %f in
432      *.bz2)  P="bzip2 -d";;
433      *.gz)   P="gzip -d";;
434      *.lz)   P="lzip -d";;
435      *.lzma) P="lzma -d";;
436      *.7z)   P="7zr x";;
437      *.xz)   P="xz -d";;
438      *.tar)  P="tar xvpf";;
439      *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
440      *.rar|*.RAR) P="unrar x -y";;
441    esac
442    exec $P %f
443
444 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
445 X  Extract another compressed file
446    case %F in
447      *.bz2)  P="bzip2 -d";;
448      *.gz)   P="gzip -d";;
449      *.lz)   P="lzip -d";;
450      *.lzma) P="lzma -d";;
451      *.7z)   P="7zr x";;
452      *.xz)   P="xz -d";;
453      *.tar)  P="tar xvpf";;
454      *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
455      *.rar|*.RAR) P="unrar x -y";;
456    esac
457    exec $P %D/%F
458
459 + t lr & f \.(zip|ZIP)$
460 y  Extract from zip recoding filenames
461    exec unzip.py %f
462
463 + T r & F \.(zip|ZIP)$
464 Y  Extract from other zip recoding filenames
465    exec unzip.py %D/%F
466
467 + t lr
468 v  View via mailcap
469    exec see %f
470
471 + t lr
472 c  Compare the file
473    exec cmp %D/%f %f
474
475 + t lr & T r
476 C  Compare these files
477    exec cmp %D/%F %f
478
479 + t lr
480 d  Diff the file
481    exec diff -u --speed-large-files %D/%f %f
482
483 + t lr & T r
484 D  Diff these files
485    exec diff -u --speed-large-files %D/%F %f
486
487 + t lr
488 v  vimdiff the file
489    exec vim -d %D/%f %f
490
491 + t lr & T r
492 V  vimdiff these files
493    exec vim -d %D/%F %f
494
495 + t d & ! f ^\.\.$
496 d  Diff the directory
497    exec diff -ru --speed-large-files \
498       -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
499
500 + t d & T d & ! F ^\.\.$
501 D  Diff these directories
502    exec diff -ru --speed-large-files \
503       -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
504
505 += f \.(asc|gpg|sig(n)?)$ & t lr
506 v  Verify signature
507    exec gpg --verify %f
508
509 += f \.[1-8]$ | f \.man$ & t lr
510 1  Display the file with roff -man
511    %view nroff -man %f
512
513 m  View a manual page
514    MAN=%{Enter manual name}
515    %view man -P cat $MAN
516
517 + t dlr | t t
518 r  rsync the file(s) there
519    rsync -ahPv --del %s %D