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