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