]> git.phdru.name Git - dotfiles.git/blob - .mc/menu
.mc/menu: Fix `gmplayer`
[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 \.(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 m  Play video file(s) with mpv
165    mplayer %s &
166
167 + 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
168 m  Play video file(s) with mpv (loud)
169    AUDIO_VOLUME=120
170    export AUDIO_VOLUME
171    mplayer %s &
172
173 + 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
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)$
175 m  Play video file(s) with mpv (louder)
176    AUDIO_VOLUME=150
177    export AUDIO_VOLUME
178    mplayer %s &
179
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)$ | t d | t t
181 m  Play video file(s) with mpv (ask for volume)
182    AUDIO_VOLUME=%{Enter volume}
183    export AUDIO_VOLUME
184    mplayer %s &
185
186 + 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
187 M  Play audio/video with mpv GUI
188    gmplayer %s &
189
190 += t d & f (video_ts|VIDEO_TS)$
191 d  Play DVD directory with mpv
192    mplayer -dvd-device . dvd:// &
193
194 + t d & f (video_ts|VIDEO_TS)$
195 D  Play DVD directory with mpv GUI
196    gmplayer -dvd-device . dvd:// &
197
198 + t d & f (video_ts|VIDEO_TS)$
199 t  Play DVD title with mpv
200    title=%{Enter title}
201    mplayer -dvd-device . dvd://"$title" &
202
203 + t d & f (video_ts|VIDEO_TS)$
204 T  Play DVD title with mpv GUI
205    title=%{Enter title}
206    gmplayer -dvd-device . dvd://"$title" &
207
208 + t d
209 p  Play directory with mpv
210    mplayer %f/* &
211
212 + t d
213 P  Play directory with mpv GUI
214    gmplayer %f/* &
215
216 + t d & f ^\.\.$
217 b  Compress the current subdirectory to tar.bz2
218    Pwd="`basename %d /`"
219    echo -n "Name of the distribution file (without extension) [$Pwd]: "
220    read tar
221    if [ "$tar"x = x ]; then tar="$Pwd"; fi
222    cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
223    echo ../"$tar".tar.bz2 created.
224
225 + t d & f ^\.\.$
226 g  Compress the current subdirectory to tar.gz
227    Pwd="`basename %d /`"
228    echo -n "Name of the distribution file (without extension) [$Pwd]: "
229    read tar
230    if [ "$tar"x = x ]; then tar="$Pwd"; fi
231    cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
232    echo ../"$tar".tar.gz created.
233
234 + t d & f ^\.\.$
235 l  Compress the current subdirectory to tar.lzma
236    Pwd="`basename %d /`"
237    echo -n "Name of the distribution file (without extension) [$Pwd]: "
238    read tar
239    if [ "$tar"x = x ]; then tar="$Pwd"; fi
240    cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
241    echo ../"$tar".tar.lzma created.
242
243 + t d & f ^\.\.$
244 x  Compress the current subdirectory to tar.xz
245    Pwd="`basename %d /`"
246    echo -n "Name of the distribution file (without extension) [$Pwd]: "
247    read tar
248    if [ "$tar"x = x ]; then tar="$Pwd"; fi
249    cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
250    echo ../"$tar".tar.xz created.
251
252 + t d & f ^\.\.$
253 t  Compress the current subdirectory to tar
254    Pwd="`basename %d /`"
255    echo -n "Name of the distribution file (without extension) [$Pwd]: "
256    read tar
257    if [ "$tar"x = x ]; then tar="$Pwd"; fi
258    cd .. && tar cvf - "$Pwd" > "$tar".tar &&
259    echo ../"$tar".tar created.
260
261 + t d & f ^\.\.$
262 z  Compress the current subdirectory to zip
263    Pwd="`basename %d /`"
264    echo -n "Name of the distribution file (without extension) [$Pwd]: "
265    read zip
266    if [ "$zip"x = x ]; then zip="$Pwd"; fi
267    cd .. && zip -r9 "$zip".zip "$Pwd" &&
268    echo ../"$zip".zip created.
269
270 + t d & f ^\.\.$
271 y  Compress the current subdirectory to zip recoding filenames
272    Pwd="`basename %d /`"
273    echo -n "Name of the distribution file (without extension) [$Pwd]: "
274    read zip
275    if [ "$zip"x = x ]; then zip="$Pwd"; fi
276    cd .. && zip.py "$zip".zip "$Pwd" &&
277    echo ../"$zip".zip created.
278
279 + t d & f ^\.\.$
280 7  Compress the current subdirectory to 7z
281    Pwd="`basename %d /`"
282    echo -n "Name of the distribution file (without extension) [$Pwd]: "
283    read ar
284    if [ "$ar"x = x ]; then ar="$Pwd"; fi
285    cd .. && 7zr a "$ar".7z "$Pwd" &&
286    echo ../"$ar".7z created.
287
288 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
289 z  bzip2 the file
290    exec bzip2 -9 %f
291
292 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
293 z  gzip the file
294    exec gzip -9 %f
295
296 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
297 z  lzip the file
298    exec lzip -9 %f
299
300 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
301 z  lzma the file
302    exec lzma -9 %f
303
304 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
305 z  7z the file/directory
306    exec 7zr a %f.7z %f
307
308 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
309 z  xz the file
310    exec xz -9 %f
311
312 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
313 z  zip the file/directory
314    exec zip -r9 %f.zip %f
315
316 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
317 y  zip the file/directory recoding filename(s)
318    exec zip.py %f.zip %f
319
320 + t t
321 Z  zip selected files/directories
322    ZIP=%{Enter zip name}
323    exec zip -r9 "$ZIP" %s
324
325 + t t
326 Y  zip selected files/directories recoding filenames
327    ZIP=%{Enter zip name}
328    exec zip.py "$ZIP" %s
329
330 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
331 n  Create a directory for this archive
332    case %f in
333      *.tar.Z)    D="`basename %f .tar.Z`";;
334      *.tar.bz2)  D="`basename %f .tar.bz2`";;
335      *.tar.gz)   D="`basename %f .tar.gz`";;
336      *.tbz2)     D="`basename %f .tbz2`";;
337      *.tgz)      D="`basename %f .tgz`";;
338      *.tz)       D="`basename %f .tz`";;
339      *.tar.lz)   D="`basename %f .tar.lz`";;
340      *.tar.lzma) D="`basename %f .tar.lzma`";;
341      *.tar.7z)   D="`basename %f .tar.7z`";;
342      *.zip)      D="`basename %f .zip`";;
343      *.ZIP)      D="`basename %f .ZIP`";;
344      *.rar)      D="`basename %f .rar`";;
345      *.RAR)      D="`basename %f .RAR`";;
346      *.xz)       D="`basename %f .xz`";;
347      *.7z)       D="`basename %f .7z`";;
348    esac
349    exec mkdir "$D"
350
351 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
352 N  Create a directory for the other archive
353    case %D/%F in
354      *.tar.Z)    D="`basename %F .tar.Z`";;
355      *.tar.bz2)  D="`basename %F .tar.bz2`";;
356      *.tar.gz)   D="`basename %F .tar.gz`";;
357      *.tbz2)     D="`basename %F .tbz2`";;
358      *.tgz)      D="`basename %F .tgz`";;
359      *.tz)       D="`basename %F .tz`";;
360      *.tar.lz)   D="`basename %F .tar.lz`";;
361      *.tar.lzma) D="`basename %F .tar.lzma`";;
362      *.tar.7z)   D="`basename %F .tar.7z`";;
363      *.zip)      D="`basename %F .zip`";;
364      *.ZIP)      D="`basename %F .ZIP`";;
365      *.rar)      D="`basename %F .rar`";;
366      *.RAR)      D="`basename %F .RAR`";;
367      *.xz)       D="`basename %F .xz`";;
368      *.7z)       D="`basename %F .7z`";;
369    esac
370    exec mkdir "$D"
371
372 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
373 x  Extract the contents of a compressed tar file
374    unset PRG
375    case %f in
376       *.tar.bz2|*.tbz2)
377          PRG="bunzip2 -c"
378       ;;
379       *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
380          PRG="gzip -dc"
381       ;;
382       *.tar.lz)
383          PRG="lzip -dc"
384       ;;
385       *.tar.lzma)
386          PRG="lzma -dc"
387       ;;
388       *.tar.7z)
389          PRG="7zr e -so"
390       ;;
391       *.tar.xz)
392          PRG="xz -dc"
393       ;;
394       *)
395       exit 1
396       ;;
397    esac
398    $PRG %f | tar xvpf -
399
400 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
401 X  Extract the contents of an other compressed tar file
402    unset PRG
403    case %F in
404       *.tar.bz2|*.tbz2)
405          PRG="bunzip2 -c"
406       ;;
407       *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
408          PRG="gzip -dc"
409       ;;
410       *.tar.lz)
411          PRG="lzip -dc"
412       ;;
413       *.tar.lzma)
414          PRG="lzma -dc"
415       ;;
416       *.tar.7z)
417          PRG="7zr e -so"
418       ;;
419       *.tar.xz)
420          PRG="xz -dc"
421       ;;
422       *)
423       exit 1
424       ;;
425    esac
426    $PRG %D/%F | tar xvpf -
427
428 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
429 x  Extract a compressed file
430    case %f in
431      *.bz2)  P="bzip2 -d";;
432      *.gz)   P="gzip -d";;
433      *.lz)   P="lzip -d";;
434      *.lzma) P="lzma -d";;
435      *.7z)   P="7zr x";;
436      *.xz)   P="xz -d";;
437      *.tar)  P="tar xvpf";;
438      *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
439      *.rar|*.RAR) P="unrar x -y";;
440    esac
441    exec $P %f
442
443 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
444 X  Extract another compressed file
445    case %F in
446      *.bz2)  P="bzip2 -d";;
447      *.gz)   P="gzip -d";;
448      *.lz)   P="lzip -d";;
449      *.lzma) P="lzma -d";;
450      *.7z)   P="7zr x";;
451      *.xz)   P="xz -d";;
452      *.tar)  P="tar xvpf";;
453      *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
454      *.rar|*.RAR) P="unrar x -y";;
455    esac
456    exec $P %D/%F
457
458 + t lr & f \.(zip|ZIP)$
459 y  Extract from zip recoding filenames
460    exec unzip.py %f
461
462 + T r & F \.(zip|ZIP)$
463 Y  Extract from other zip recoding filenames
464    exec unzip.py %D/%F
465
466 + t lr
467 v  View via mailcap
468    exec see %f
469
470 + t lr
471 c  Compare the file
472    exec cmp %D/%f %f
473
474 + t lr & T r
475 C  Compare these files
476    exec cmp %D/%F %f
477
478 + t lr
479 d  Diff the file
480    exec diff -u --speed-large-files %D/%f %f
481
482 + t lr & T r
483 D  Diff these files
484    exec diff -u --speed-large-files %D/%F %f
485
486 + t lr
487 v  vimdiff the file
488    exec vim -d %D/%f %f
489
490 + t lr & T r
491 V  vimdiff these files
492    exec vim -d %D/%F %f
493
494 + t d & ! f ^\.\.$
495 d  Diff the directory
496    exec diff -ru --speed-large-files \
497       -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
498
499 + t d & T d & ! F ^\.\.$
500 D  Diff these directories
501    exec diff -ru --speed-large-files \
502       -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
503
504 += f \.(asc|gpg|sig(n)?)$ & t lr
505 v  Verify signature
506    exec gpg --verify %f
507
508 += f \.[1-8]$ | f \.man$ & t lr
509 1  Display the file with roff -man
510    %view nroff -man %f
511
512 m  View a manual page
513    MAN=%{Enter manual name}
514    %view man -P cat $MAN
515
516 + t dlr | t t
517 r  rsync the file(s) there
518    rsync -ahPv --del %s %D