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 \.djvu(\.bz2|\.gz)?$
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
80 + 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)$
81 v View (Open)Docs with libreoffice
82 #libreoffice --headless --convert-to "txt:Text (encoded):UTF8" %f
83 libreoffice --cat %f | ${PAGER:-more}
85 += t lr & f \.(doc|DOC|rtf)$
86 d View doc with catdoc
87 catdoc %f | ${PAGER:-more}
89 += t lr & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
90 o View OpenDoc with odt2txt
91 odt2txt %f | ${PAGER:-more}
93 += t lr & f \.(docx|DOCX)$
94 d View docx with docx2txt
95 docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
97 += t lr & f \.(xls|XLS|xlsx|XLSX)$
98 o View OpenXlsx with xlsx2csv
99 xlsx2csv %f | iconv.py -f utf-8 | ${PAGER:-more}
101 += t lr & f \.(xls|XLS)$
102 x View xls with xls2csv
103 xls2csv %f | ${PAGER:-more}
105 + 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
109 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
110 = t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
111 i View image(s) scaled
112 xli -title "`echo %s | sed 's/ /_/g'`" -zoom auto %s &
114 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
115 I View image(s) full size
116 xli -title "`echo %s | sed 's/ /_/g'`" %s &
118 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
122 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$ | t t
123 = t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
124 I View icon, JPEG-2000, TIFF, WebP image
127 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
131 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
132 a Add the audiofile(s) or playlist(s)
133 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
136 *.m3u) while read song; do
137 audtool --playlist-addurl "$song"
139 *) audtool --playlist-addurl "$f" ;;
142 #deadbeef --queue %s &
144 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
145 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
146 p Load the audiofile(s) or playlist(s)
147 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
148 audtool --playlist-clear
151 *.m3u) while read song; do
152 audtool --playlist-addurl "$song"
154 *) audtool --playlist-addurl "$f" ;;
157 #deadbeef --queue %s &
159 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
160 P Play the audiofile(s) or playlist(s)
161 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
162 audtool --playlist-clear
165 *.m3u) while read song; do
166 audtool --playlist-addurl "$song"
168 *) audtool --playlist-addurl "$f" ;;
171 exec audtool --playback-play
172 #mplayer -playlist %f &
176 R Play the playlist in random order
177 "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
178 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
179 audtool --playlist-clear
181 audtool --playlist-addurl "$song"
182 done < random-playlist-tmp.m3u
183 audtool --playback-play
184 #mplayer -playlist random-playlist-tmp.m3u &
185 #deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
186 (sleep 5; exec rm random-playlist-tmp.m3u) &
188 + 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)$
190 exec "$HOME"/.config/mpv/mpv_identify.sh %f
192 + t d & f (video_ts|VIDEO_TS)$
194 exec "$HOME"/.config/mpv/mpv_identify.sh .
196 + 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
197 m Play video file(s) with mpv
200 + 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
201 m Play video file(s) with mpv (loud)
206 + 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
207 = 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)$
208 m Play video file(s) with mpv (louder)
213 + 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
214 m Play video file(s) with mpv (ask for volume)
215 AUDIO_VOLUME=%{Enter volume}
219 + 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
220 M Play audio/video with mpv GUI
223 += t d & f (video_ts|VIDEO_TS)$
224 d Play DVD directory with mpv
225 mplayer -dvd-device . dvd:// &
227 + t d & f (video_ts|VIDEO_TS)$
228 D Play DVD directory with mpv GUI
229 gmplayer -dvd-device . dvd:// &
231 + t d & f (video_ts|VIDEO_TS)$
232 t Play DVD title with mpv
234 mplayer -dvd-device . dvd://"$title" &
236 + t d & f (video_ts|VIDEO_TS)$
237 T Play DVD title with mpv GUI
239 gmplayer -dvd-device . dvd://"$title" &
242 p Play directory with mpv
246 P Play directory with mpv GUI
250 b Compress the current subdirectory to tar.bz2
251 Pwd="`basename %d /`"
252 echo -n "Name of the distribution file (without extension) [$Pwd]: "
254 if [ "$tar"x = x ]; then tar="$Pwd"; fi
255 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
256 echo ../"$tar".tar.bz2 created.
259 g Compress the current subdirectory to tar.gz
260 Pwd="`basename %d /`"
261 echo -n "Name of the distribution file (without extension) [$Pwd]: "
263 if [ "$tar"x = x ]; then tar="$Pwd"; fi
264 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
265 echo ../"$tar".tar.gz created.
268 l Compress the current subdirectory to tar.lzma
269 Pwd="`basename %d /`"
270 echo -n "Name of the distribution file (without extension) [$Pwd]: "
272 if [ "$tar"x = x ]; then tar="$Pwd"; fi
273 cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
274 echo ../"$tar".tar.lzma created.
277 x Compress the current subdirectory to tar.xz
278 Pwd="`basename %d /`"
279 echo -n "Name of the distribution file (without extension) [$Pwd]: "
281 if [ "$tar"x = x ]; then tar="$Pwd"; fi
282 cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
283 echo ../"$tar".tar.xz created.
286 t Compress the current subdirectory to tar
287 Pwd="`basename %d /`"
288 echo -n "Name of the distribution file (without extension) [$Pwd]: "
290 if [ "$tar"x = x ]; then tar="$Pwd"; fi
291 cd .. && tar cvf - "$Pwd" > "$tar".tar &&
292 echo ../"$tar".tar created.
295 z Compress the current subdirectory to zip
296 Pwd="`basename %d /`"
297 echo -n "Name of the distribution file (without extension) [$Pwd]: "
299 if [ "$zip"x = x ]; then zip="$Pwd"; fi
300 cd .. && zip -r9 "$zip".zip "$Pwd" &&
301 echo ../"$zip".zip created.
304 y Compress the current subdirectory to zip recoding filenames
305 Pwd="`basename %d /`"
306 echo -n "Name of the distribution file (without extension) [$Pwd]: "
308 if [ "$zip"x = x ]; then zip="$Pwd"; fi
309 cd .. && zip.py "$zip".zip "$Pwd" &&
310 echo ../"$zip".zip created.
313 7 Compress the current subdirectory to 7z
314 Pwd="`basename %d /`"
315 echo -n "Name of the distribution file (without extension) [$Pwd]: "
317 if [ "$ar"x = x ]; then ar="$Pwd"; fi
318 cd .. && 7zr a "$ar".7z "$Pwd" &&
319 echo ../"$ar".7z created.
321 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
325 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & 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
338 z 7z the file/directory
341 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
345 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
346 z zip the file/directory
347 exec zip -r9 %f.zip %f
349 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
350 y zip the file/directory recoding filename(s)
351 exec zip.py %f.zip %f
354 Z zip selected files/directories
355 ZIP=%{Enter zip name}
356 exec zip -r9 "$ZIP" %s
359 Y zip selected files/directories recoding filenames
360 ZIP=%{Enter zip name}
361 exec zip.py "$ZIP" %s
363 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
364 n Create a directory for this archive
366 *.tar.Z) D="`basename %f .tar.Z`";;
367 *.tar.bz2) D="`basename %f .tar.bz2`";;
368 *.tar.gz) D="`basename %f .tar.gz`";;
369 *.tbz2) D="`basename %f .tbz2`";;
370 *.tgz) D="`basename %f .tgz`";;
371 *.tz) D="`basename %f .tz`";;
372 *.tar.lz) D="`basename %f .tar.lz`";;
373 *.tar.lzma) D="`basename %f .tar.lzma`";;
374 *.tar.7z) D="`basename %f .tar.7z`";;
375 *.zip) D="`basename %f .zip`";;
376 *.ZIP) D="`basename %f .ZIP`";;
377 *.rar) D="`basename %f .rar`";;
378 *.RAR) D="`basename %f .RAR`";;
379 *.xz) D="`basename %f .xz`";;
380 *.7z) D="`basename %f .7z`";;
384 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
385 N Create a directory for the other archive
387 *.tar.Z) D="`basename %F .tar.Z`";;
388 *.tar.bz2) D="`basename %F .tar.bz2`";;
389 *.tar.gz) D="`basename %F .tar.gz`";;
390 *.tbz2) D="`basename %F .tbz2`";;
391 *.tgz) D="`basename %F .tgz`";;
392 *.tz) D="`basename %F .tz`";;
393 *.tar.lz) D="`basename %F .tar.lz`";;
394 *.tar.lzma) D="`basename %F .tar.lzma`";;
395 *.tar.7z) D="`basename %F .tar.7z`";;
396 *.zip) D="`basename %F .zip`";;
397 *.ZIP) D="`basename %F .ZIP`";;
398 *.rar) D="`basename %F .rar`";;
399 *.RAR) D="`basename %F .RAR`";;
400 *.xz) D="`basename %F .xz`";;
401 *.7z) D="`basename %F .7z`";;
405 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
406 x Extract the contents of a compressed tar file
412 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
433 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
434 X Extract the contents of an other compressed tar file
440 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
459 $PRG %D/%F | tar xvpf -
461 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
462 x Extract a compressed file
464 *.bz2) P="bzip2 -d";;
467 *.lzma) P="lzma -d";;
470 *.tar) P="tar xvpf";;
471 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
472 *.rar|*.RAR) P="unrar x -y";;
476 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
477 X Extract another compressed file
479 *.bz2) P="bzip2 -d";;
482 *.lzma) P="lzma -d";;
485 *.tar) P="tar xvpf";;
486 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
487 *.rar|*.RAR) P="unrar x -y";;
491 + t lr & f \.(zip|ZIP)$
492 y Extract from zip recoding filenames
495 + T r & F \.(zip|ZIP)$
496 Y Extract from other zip recoding filenames
508 C Compare these files
513 exec diff -u --speed-large-files %D/%f %f
517 exec diff -u --speed-large-files %D/%F %f
524 V vimdiff these files
529 exec diff -ru --speed-large-files \
530 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
532 + t d & T d & ! F ^\.\.$
533 D Diff these directories
534 exec diff -ru --speed-large-files \
535 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
537 += f \.(asc|gpg|sig(n)?)$ & t lr
541 += f \.[1-8]$ | f \.man$ & t lr
542 1 Display the file with roff -man
546 MAN=%{Enter manual name}
547 %view man -P cat $MAN
550 r rsync the file(s) there
551 rsync -ahPv --del %s %D