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
177 #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 deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
189 #mplayer -playlist random-playlist-tmp.m3u &
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 (quiet)
206 + 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
207 m Play video file(s) with mpv (normal)
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 m Play video file(s) with mpv (loud)
216 + 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
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)$
218 m Play video file(s) with mpv (louder)
223 + 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
224 m Play video file(s) with mpv (ask for volume)
225 AUDIO_VOLUME=%{Enter volume}
229 + 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
230 M Play audio/video with mpv GUI
233 += t d & f (video_ts|VIDEO_TS)$
234 d Play DVD directory with mpv
235 mplayer -dvd-device . dvd:// &
237 + t d & f (video_ts|VIDEO_TS)$
238 D Play DVD directory with mpv GUI
239 gmplayer -dvd-device . dvd:// &
241 + t d & f (video_ts|VIDEO_TS)$
242 t Play DVD title with mpv
244 mplayer -dvd-device . dvd://"$title" &
246 + t d & f (video_ts|VIDEO_TS)$
247 T Play DVD title with mpv GUI
249 gmplayer -dvd-device . dvd://"$title" &
252 p Play directory with mpv
256 P Play directory with mpv GUI
260 b Compress the current subdirectory to tar.bz2
261 Pwd="`basename %d /`"
262 echo -n "Name of the distribution file (without extension) [$Pwd]: "
264 if [ "$tar"x = x ]; then tar="$Pwd"; fi
265 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
266 echo ../"$tar".tar.bz2 created.
269 g Compress the current subdirectory to tar.gz
270 Pwd="`basename %d /`"
271 echo -n "Name of the distribution file (without extension) [$Pwd]: "
273 if [ "$tar"x = x ]; then tar="$Pwd"; fi
274 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
275 echo ../"$tar".tar.gz created.
278 l Compress the current subdirectory to tar.lzma
279 Pwd="`basename %d /`"
280 echo -n "Name of the distribution file (without extension) [$Pwd]: "
282 if [ "$tar"x = x ]; then tar="$Pwd"; fi
283 cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
284 echo ../"$tar".tar.lzma created.
287 x Compress the current subdirectory to tar.xz
288 Pwd="`basename %d /`"
289 echo -n "Name of the distribution file (without extension) [$Pwd]: "
291 if [ "$tar"x = x ]; then tar="$Pwd"; fi
292 cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
293 echo ../"$tar".tar.xz created.
296 t Compress the current subdirectory to tar
297 Pwd="`basename %d /`"
298 echo -n "Name of the distribution file (without extension) [$Pwd]: "
300 if [ "$tar"x = x ]; then tar="$Pwd"; fi
301 cd .. && tar cvf - "$Pwd" > "$tar".tar &&
302 echo ../"$tar".tar created.
305 z Compress the current subdirectory to zip
306 Pwd="`basename %d /`"
307 echo -n "Name of the distribution file (without extension) [$Pwd]: "
309 if [ "$zip"x = x ]; then zip="$Pwd"; fi
310 cd .. && zip -r9 "$zip".zip "$Pwd" &&
311 echo ../"$zip".zip created.
314 y Compress the current subdirectory to zip recoding filenames
315 Pwd="`basename %d /`"
316 echo -n "Name of the distribution file (without extension) [$Pwd]: "
318 if [ "$zip"x = x ]; then zip="$Pwd"; fi
319 cd .. && zip.py "$zip".zip "$Pwd" &&
320 echo ../"$zip".zip created.
323 7 Compress the current subdirectory to 7z
324 Pwd="`basename %d /`"
325 echo -n "Name of the distribution file (without extension) [$Pwd]: "
327 if [ "$ar"x = x ]; then ar="$Pwd"; fi
328 cd .. && 7zr a "$ar".7z "$Pwd" &&
329 echo ../"$ar".7z created.
331 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
335 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
339 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
343 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
347 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
348 z 7z the file/directory
351 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
355 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
356 z zip the file/directory
357 exec zip -r9 %f.zip %f
359 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
360 y zip the file/directory recoding filename(s)
361 exec zip.py %f.zip %f
364 Z zip selected files/directories
365 ZIP=%{Enter zip name}
366 exec zip -r9 "$ZIP" %s
369 Y zip selected files/directories recoding filenames
370 ZIP=%{Enter zip name}
371 exec zip.py "$ZIP" %s
373 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
374 n Create a directory for this archive
376 *.tar.Z) D="`basename %f .tar.Z`";;
377 *.tar.bz2) D="`basename %f .tar.bz2`";;
378 *.tar.gz) D="`basename %f .tar.gz`";;
379 *.tbz2) D="`basename %f .tbz2`";;
380 *.tgz) D="`basename %f .tgz`";;
381 *.tz) D="`basename %f .tz`";;
382 *.tar.lz) D="`basename %f .tar.lz`";;
383 *.tar.lzma) D="`basename %f .tar.lzma`";;
384 *.tar.7z) D="`basename %f .tar.7z`";;
385 *.zip) D="`basename %f .zip`";;
386 *.ZIP) D="`basename %f .ZIP`";;
387 *.rar) D="`basename %f .rar`";;
388 *.RAR) D="`basename %f .RAR`";;
389 *.xz) D="`basename %f .xz`";;
390 *.7z) D="`basename %f .7z`";;
394 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
395 N Create a directory for the other archive
397 *.tar.Z) D="`basename %F .tar.Z`";;
398 *.tar.bz2) D="`basename %F .tar.bz2`";;
399 *.tar.gz) D="`basename %F .tar.gz`";;
400 *.tbz2) D="`basename %F .tbz2`";;
401 *.tgz) D="`basename %F .tgz`";;
402 *.tz) D="`basename %F .tz`";;
403 *.tar.lz) D="`basename %F .tar.lz`";;
404 *.tar.lzma) D="`basename %F .tar.lzma`";;
405 *.tar.7z) D="`basename %F .tar.7z`";;
406 *.zip) D="`basename %F .zip`";;
407 *.ZIP) D="`basename %F .ZIP`";;
408 *.rar) D="`basename %F .rar`";;
409 *.RAR) D="`basename %F .RAR`";;
410 *.xz) D="`basename %F .xz`";;
411 *.7z) D="`basename %F .7z`";;
415 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
416 x Extract the contents of a compressed tar file
422 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
443 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
444 X Extract the contents of an other compressed tar file
450 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
469 $PRG %D/%F | tar xvpf -
471 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
472 x Extract a compressed file
474 *.bz2) P="bzip2 -d";;
477 *.lzma) P="lzma -d";;
480 *.tar) P="tar xvpf";;
481 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
482 *.rar|*.RAR) P="unrar x -y";;
486 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
487 X Extract another compressed file
489 *.bz2) P="bzip2 -d";;
492 *.lzma) P="lzma -d";;
495 *.tar) P="tar xvpf";;
496 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
497 *.rar|*.RAR) P="unrar x -y";;
501 + t lr & f \.(zip|ZIP)$
502 y Extract from zip recoding filenames
505 + T r & F \.(zip|ZIP)$
506 Y Extract from other zip recoding filenames
518 C Compare these files
523 exec diff -u --speed-large-files %D/%f %f
527 exec diff -u --speed-large-files %D/%F %f
534 V vimdiff these files
539 exec diff -ru --speed-large-files \
540 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
542 + t d & T d & ! F ^\.\.$
543 D Diff these directories
544 exec diff -ru --speed-large-files \
545 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
547 += f \.(asc|gpg|sig(n)?)$ & t lr
551 += f \.[1-8]$ | f \.man$ & t lr
552 1 Display the file with roff -man
556 MAN=%{Enter manual name}
557 %view man -P cat $MAN
560 r rsync the file(s) there
561 rsync -ahPv --del %s %D