3 # This is necessary to overcome a bug in mc - without this
4 # mc makes default wrong item
8 @ Do something on all of the file(s) at once
13 @ Do something on the selected files one by one
20 p View the file in a pager
21 exec ${PAGER:-more} %f
24 g Edit the file in gvim
28 b View the file in a browser
29 exec webbrowser-encode-url -e utf-8 file://%d/%f
33 w View the file in a new browser window
34 exec webbrowser-encode-url -e utf-8 -n file://%d/%f
37 t View the file in a new browser tab
38 exec webbrowser-encode-url -e utf-8 -t file://%d/%f
40 += f \.fb2(\.bz2|\.gz|\.zip)?$ | f \.(chm|epub|htm(l?)|txt|rtf)$ & t lr
41 f View fb2/chm/epub with fbreader
44 + t lr & f \.fb2(\.bz2|\.gz|\.zip)$
47 *.fb2.bz2) A="bunzip2 -c" ;;
48 *.fb2.gz) A="gunzip -c" ;;
49 *.fb2.zip) A="unzip -p" ;;
52 $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_html_ru.xsl - | webstdin -t
54 + t lr & f \.fb2(\.bz2|\.gz|\.zip)$
57 *.fb2.bz2) A="bunzip2 -c" ;;
58 *.fb2.gz) A="gunzip -c" ;;
59 *.fb2.zip) A="unzip -p" ;;
62 $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_txt_ru.xsl - | webstdin -e txt -t
64 + t lr & f \.(pdf|PDF)$
66 pdftotext -layout -q %f - | iconv.py -f utf-8 | ${PAGER:-more}
68 + t lr & f \.(pdf|PDF)$
69 e View pdf with evince
72 += t lr & f \.(pdf|PDF)$
73 e View pdf with qpdfview
74 if [ "%d/%f" = "`echo %d/%f | iconv -t utf-8`" ]; then qpdfview %f & else src=%d/%f; dest="$HOME/tmp/`echo $src | koi2lat | sed 's!/!%!g'`"; ln -s "$src" "$dest" && qpdfview "$dest" & (sleep 3; exec rm -f "$dest") & fi
76 += t lr & f \.djvu(\.bz2|\.gz)?$
80 + 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)$
81 e Edit (Open)Docs with libreoffice
84 + 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)$
85 v View (Open)Docs with libreoffice
86 #libreoffice --headless --convert-to "txt:Text (encoded):UTF8" %f
87 libreoffice --cat %f | ${PAGER:-more}
89 += t lr & f \.(doc|DOC|rtf)$
90 d View doc with catdoc
91 catdoc %f | ${PAGER:-more}
93 += t lr & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
94 o View OpenDoc with odt2txt
95 odt2txt %f | ${PAGER:-more}
97 += t lr & f \.(docx|DOCX)$
98 d View docx with docx2txt
99 docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
101 += t lr & f \.(xls|XLS|xlsx|XLSX)$
102 o View OpenXlsx with xlsx2csv
103 xlsx2csv %f | iconv.py -f utf-8 | ${PAGER:-more}
105 += t lr & f \.(xls|XLS)$
106 x View xls with xls2csv
107 xls2csv %f | ${PAGER:-more}
109 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm|ico|jp2|tif|TIF|tiff|TIFF|webp)$ | t t
113 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
114 = t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
115 i View image(s) scaled
116 xli -title "`echo %s | sed 's/ /_/g'`" -zoom auto %s &
118 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
119 I View image(s) full size
120 xli -title "`echo %s | sed 's/ /_/g'`" %s &
122 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
126 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$ | t t
127 = t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
128 I View icon, JPEG-2000, TIFF, WebP image
131 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
135 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
136 a Add the audiofile(s) or playlist(s)
137 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
140 *.m3u8?) while read song; do
141 audtool --playlist-addurl "$song"
143 *) audtool --playlist-addurl "$f" ;;
146 #deadbeef --queue %s &
148 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
149 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
150 p Load the audiofile(s) or playlist(s)
151 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
152 audtool --playlist-clear
155 *.m3u8?) while read song; do
156 audtool --playlist-addurl "$song"
158 *) audtool --playlist-addurl "$f" ;;
161 #deadbeef --queue %s &
163 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
164 P Play the audiofile(s) or playlist(s)
165 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
166 audtool --playlist-clear
169 *.m3u8?) while read song; do
170 audtool --playlist-addurl "$song"
172 *) audtool --playlist-addurl "$f" ;;
175 exec audtool --playback-play
176 #mplayer -playlist %f &
180 R Play the playlist in random order
181 "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
182 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
183 audtool --playlist-clear
185 audtool --playlist-addurl "$song"
186 done < random-playlist-tmp.m3u
187 audtool --playback-play
188 #mplayer -playlist random-playlist-tmp.m3u &
189 #deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
190 (sleep 5; exec rm random-playlist-tmp.m3u) &
192 + t lr & f \.(m3u8?|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)$
194 exec "$HOME"/.config/mpv/mpv_identify.sh %f
196 + t d & f (video_ts|VIDEO_TS)$
198 exec "$HOME"/.config/mpv/mpv_identify.sh .
200 + f \.(aac|ac3|ape|cue|dts|flac|m3u8?|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
201 m Play video file(s) with mpv
204 + f \.(aac|ac3|ape|cue|dts|flac|m3u8?|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
205 m Play video file(s) with mpv (loud)
210 + f \.(aac|ac3|ape|cue|dts|flac|m3u8?|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
211 = f \.(aac|ac3|ape|cue|dts|flac|m3u8?|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)$
212 m Play video file(s) with mpv (louder)
217 + f \.(aac|ac3|ape|cue|dts|flac|m3u8?|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
218 m Play video file(s) with mpv (ask for volume)
219 AUDIO_VOLUME=%{Enter volume}
223 + f \.(m3u8?|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
224 M Play audio/video with mpv GUI
227 += t d & f (video_ts|VIDEO_TS)$
228 d Play DVD directory with mpv
229 mplayer -dvd-device . dvd:// &
231 + t d & f (video_ts|VIDEO_TS)$
232 D Play DVD directory with mpv GUI
233 gmplayer -dvd-device . dvd:// &
235 + t d & f (video_ts|VIDEO_TS)$
236 t Play DVD title with mpv
238 mplayer -dvd-device . dvd://"$title" &
240 + t d & f (video_ts|VIDEO_TS)$
241 T Play DVD title with mpv GUI
243 gmplayer -dvd-device . dvd://"$title" &
246 p Play directory with mpv
250 P Play directory with mpv GUI
254 b Compress the current subdirectory to tar.bz2
255 Pwd="`basename %d /`"
256 echo -n "Name of the distribution file (without extension) [$Pwd]: "
258 if [ "$tar"x = x ]; then tar="$Pwd"; fi
259 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
260 echo ../"$tar".tar.bz2 created.
263 g Compress the current subdirectory to tar.gz
264 Pwd="`basename %d /`"
265 echo -n "Name of the distribution file (without extension) [$Pwd]: "
267 if [ "$tar"x = x ]; then tar="$Pwd"; fi
268 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
269 echo ../"$tar".tar.gz created.
272 l Compress the current subdirectory to tar.lzma
273 Pwd="`basename %d /`"
274 echo -n "Name of the distribution file (without extension) [$Pwd]: "
276 if [ "$tar"x = x ]; then tar="$Pwd"; fi
277 cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
278 echo ../"$tar".tar.lzma created.
281 x Compress the current subdirectory to tar.xz
282 Pwd="`basename %d /`"
283 echo -n "Name of the distribution file (without extension) [$Pwd]: "
285 if [ "$tar"x = x ]; then tar="$Pwd"; fi
286 cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
287 echo ../"$tar".tar.xz created.
290 t Compress the current subdirectory to tar
291 Pwd="`basename %d /`"
292 echo -n "Name of the distribution file (without extension) [$Pwd]: "
294 if [ "$tar"x = x ]; then tar="$Pwd"; fi
295 cd .. && tar cvf - "$Pwd" > "$tar".tar &&
296 echo ../"$tar".tar created.
299 z Compress the current subdirectory to zip
300 Pwd="`basename %d /`"
301 echo -n "Name of the distribution file (without extension) [$Pwd]: "
303 if [ "$zip"x = x ]; then zip="$Pwd"; fi
304 cd .. && zip -r9 "$zip".zip "$Pwd" &&
305 echo ../"$zip".zip created.
308 y Compress the current subdirectory to zip recoding filenames
309 Pwd="`basename %d /`"
310 echo -n "Name of the distribution file (without extension) [$Pwd]: "
312 if [ "$zip"x = x ]; then zip="$Pwd"; fi
313 cd .. && zip.py "$zip".zip "$Pwd" &&
314 echo ../"$zip".zip created.
317 7 Compress the current subdirectory to 7z
318 Pwd="`basename %d /`"
319 echo -n "Name of the distribution file (without extension) [$Pwd]: "
321 if [ "$ar"x = x ]; then ar="$Pwd"; fi
322 cd .. && 7zr a "$ar".7z "$Pwd" &&
323 echo ../"$ar".7z created.
325 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
329 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
333 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
337 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
341 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
342 z 7z the file/directory
345 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
349 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
350 z zip the file/directory
351 exec zip -r9 %f.zip %f
353 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
354 y zip the file/directory recoding filename(s)
355 exec zip.py %f.zip %f
358 Z zip selected files/directories
359 ZIP=%{Enter zip name}
360 exec zip -r9 "$ZIP" %s
363 Y zip selected files/directories recoding filenames
364 ZIP=%{Enter zip name}
365 exec zip.py "$ZIP" %s
367 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
368 n Create a directory for this archive
370 *.tar.Z) D="`basename %f .tar.Z`";;
371 *.tar.bz2) D="`basename %f .tar.bz2`";;
372 *.tar.gz) D="`basename %f .tar.gz`";;
373 *.tbz2) D="`basename %f .tbz2`";;
374 *.tgz) D="`basename %f .tgz`";;
375 *.tz) D="`basename %f .tz`";;
376 *.tar.lz) D="`basename %f .tar.lz`";;
377 *.tar.lzma) D="`basename %f .tar.lzma`";;
378 *.tar.7z) D="`basename %f .tar.7z`";;
379 *.zip) D="`basename %f .zip`";;
380 *.ZIP) D="`basename %f .ZIP`";;
381 *.rar) D="`basename %f .rar`";;
382 *.RAR) D="`basename %f .RAR`";;
383 *.xz) D="`basename %f .xz`";;
384 *.7z) D="`basename %f .7z`";;
388 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
389 N Create a directory for the other archive
391 *.tar.Z) D="`basename %F .tar.Z`";;
392 *.tar.bz2) D="`basename %F .tar.bz2`";;
393 *.tar.gz) D="`basename %F .tar.gz`";;
394 *.tbz2) D="`basename %F .tbz2`";;
395 *.tgz) D="`basename %F .tgz`";;
396 *.tz) D="`basename %F .tz`";;
397 *.tar.lz) D="`basename %F .tar.lz`";;
398 *.tar.lzma) D="`basename %F .tar.lzma`";;
399 *.tar.7z) D="`basename %F .tar.7z`";;
400 *.zip) D="`basename %F .zip`";;
401 *.ZIP) D="`basename %F .ZIP`";;
402 *.rar) D="`basename %F .rar`";;
403 *.RAR) D="`basename %F .RAR`";;
404 *.xz) D="`basename %F .xz`";;
405 *.7z) D="`basename %F .7z`";;
409 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
410 x Extract the contents of a compressed tar file
416 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
437 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
438 X Extract the contents of an other compressed tar file
444 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
463 $PRG %D/%F | tar xvpf -
465 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
466 x Extract a compressed file
468 *.bz2) P="bzip2 -d";;
471 *.lzma) P="lzma -d";;
474 *.tar) P="tar xvpf";;
475 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
476 *.rar|*.RAR) P="unrar x -y";;
480 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
481 X Extract another compressed file
483 *.bz2) P="bzip2 -d";;
486 *.lzma) P="lzma -d";;
489 *.tar) P="tar xvpf";;
490 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
491 *.rar|*.RAR) P="unrar x -y";;
495 + t lr & f \.(zip|ZIP)$
496 y Extract from zip recoding filenames
499 + T r & F \.(zip|ZIP)$
500 Y Extract from other zip recoding filenames
512 C Compare these files
517 exec diff -u --speed-large-files %D/%f %f
521 exec diff -u --speed-large-files %D/%F %f
528 V vimdiff these files
533 exec diff -ru --speed-large-files \
534 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
536 + t d & T d & ! F ^\.\.$
537 D Diff these directories
538 exec diff -ru --speed-large-files \
539 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
541 += f \.(asc|gpg|sig(n)?)$ & t lr
545 += f \.[1-8]$ | f \.man$ & t lr
546 1 Display the file with roff -man
550 MAN=%{Enter manual name}
551 %view man -P cat $MAN
554 r rsync the file(s) there
555 rsync -ahPv --del %s %D