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
41 p View the file in a new private browser tab
42 exec webbrowser -p file://%d/%f
44 += f \.fb2(\.bz2|\.gz|\.zip)?$ | f \.(chm|epub|htm(l?)|txt|rtf)$ & t lr
45 f View fb2/chm/epub with fbreader
48 + t lr & f \.fb2(\.bz2|\.gz|\.zip)$
51 *.fb2.bz2) A="bunzip2 -c" ;;
52 *.fb2.gz) A="gunzip -c" ;;
53 *.fb2.zip) A="unzip -p" ;;
56 $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_html_ru.xsl - | webstdin -t
58 + t lr & f \.fb2(\.bz2|\.gz|\.zip)$
61 *.fb2.bz2) A="bunzip2 -c" ;;
62 *.fb2.gz) A="gunzip -c" ;;
63 *.fb2.zip) A="unzip -p" ;;
66 $A %f | xsltproc /usr/local/src/FictionBook/FB2_2_txt_ru.xsl - | webstdin -e txt -t
68 + t lr & f \.(pdf|PDF)$
70 pdftotext -layout -q %f - | iconv.py -f utf-8 | ${PAGER:-more}
72 + t lr & f \.(pdf|PDF)$
73 e View pdf with evince
76 += t lr & f \.(pdf|PDF)$
77 e View pdf with qpdfview
78 if [ %d/%f = "`echo %d/%f | iconv -t utf-8`" ]; then qpdfview %f & else src=%d/%f; dest="$HOME/tmp/`echo $src | iconv -t koi8-r | koi2lat | sed 's!/!%!g'`"; ln -s "$src" "$dest" && qpdfview "$dest" & (sleep 3; exec rm -f "$dest") & fi
80 += t lr & f \.djvu(\.bz2|\.gz)?$
84 + 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)$
85 e Edit (Open)Docs with libreoffice
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}
93 += t lr & f \.(doc|DOC|rtf)$
94 d View doc with catdoc
95 catdoc %f | ${PAGER:-more}
97 += t lr & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
98 o View OpenDoc with odt2txt
99 odt2txt %f | ${PAGER:-more}
101 += t lr & f \.(docx|DOCX)$
102 d View docx with docx2txt
103 docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
105 += t lr & f \.(xls|XLS|xlsx|XLSX)$
106 o View OpenXlsx with xlsx2csv
107 xlsx2csv %f | iconv.py -f utf-8 | ${PAGER:-more}
109 += t lr & f \.(xls|XLS)$
110 x View xls with xls2csv
111 xls2csv %f | ${PAGER:-more}
113 + 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
117 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
118 = t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
119 i View image(s) scaled
120 xli -title "`echo %s | sed 's/[ .]/_/g'`" -zoom auto %s &
122 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
123 I View image(s) full size
124 xli -title "`echo %s | sed 's/[ .]/_/g'`" %s &
126 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
130 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$ | t t
131 = t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
132 I View icon, JPEG-2000, TIFF, WebP image
135 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
139 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
140 a Add the audiofile(s) or playlist(s)
141 #if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
144 # *.m3u8?) while read song; do
145 # audtool --playlist-addurl "$song"
147 # *) audtool --playlist-addurl "$f" ;;
150 deadbeef --queue %s &
152 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
153 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
154 p Load the audiofile(s) or playlist(s)
155 #if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
156 #audtool --playlist-clear
159 # *.m3u8?) while read song; do
160 # audtool --playlist-addurl "$song"
162 # *) audtool --playlist-addurl "$f" ;;
165 deadbeef %s & (sleep 1; exec deadbeef --stop)
167 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u8?|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
168 P Play the audiofile(s) or playlist(s)
169 #if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
170 #audtool --playlist-clear
173 # *.m3u8?) while read song; do
174 # audtool --playlist-addurl "$song"
176 # *) audtool --playlist-addurl "$f" ;;
179 #exec audtool --playback-play
181 #mplayer -playlist %f &
184 R Play the playlist in random order
185 "$HOME"/prog/audio-cdr-video/audio/shuffle-playlist.py %f /tmp/random-playlist-tmp.m3u
186 #if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
187 #audtool --playlist-clear
189 # audtool --playlist-addurl "$song"
190 #done < /tmp/random-playlist-tmp.m3u
191 #audtool --playback-play
192 deadbeef /tmp/random-playlist-tmp.m3u &
193 #mplayer -playlist /tmp/random-playlist-tmp.m3u &
194 (sleep 5; exec rm /tmp/random-playlist-tmp.m3u) &
196 + 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)$
198 exec "$HOME"/.config/mpv/mpv_identify.sh %f
200 + t d & f (video_ts|VIDEO_TS)$
202 exec "$HOME"/.config/mpv/mpv_identify.sh .
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 (quiet)
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 (normal)
214 + 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
215 = 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)$
216 m Play video file(s) with mpv (loud)
221 + 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
222 m Play video file(s) with mpv (louder)
227 + 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
228 m Play video file(s) with mpv (ask for volume)
229 AUDIO_VOLUME=%{Enter volume}
233 + 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
234 M Play audio/video with mpv GUI
237 += t d & f (video_ts|VIDEO_TS)$
238 d Play DVD directory with mpv
239 mplayer -dvd-device . dvd:// &
241 + t d & f (video_ts|VIDEO_TS)$
242 D Play DVD directory with mpv GUI
243 gmplayer -dvd-device . dvd:// &
245 + t d & f (video_ts|VIDEO_TS)$
246 t Play DVD title with mpv
248 mplayer -dvd-device . dvd://"$title" &
250 + t d & f (video_ts|VIDEO_TS)$
251 T Play DVD title with mpv GUI
253 gmplayer -dvd-device . dvd://"$title" &
256 p Play directory with mpv
260 P Play directory with mpv GUI
264 b Compress the current subdirectory to tar.bz2
265 Pwd="`basename %d /`"
266 echo -n "Name of the distribution file (without extension) [$Pwd]: "
268 if [ "$tar"x = x ]; then tar="$Pwd"; fi
269 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
270 echo ../"$tar".tar.bz2 created.
273 g Compress the current subdirectory to tar.gz
274 Pwd="`basename %d /`"
275 echo -n "Name of the distribution file (without extension) [$Pwd]: "
277 if [ "$tar"x = x ]; then tar="$Pwd"; fi
278 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
279 echo ../"$tar".tar.gz created.
282 l Compress the current subdirectory to tar.lzma
283 Pwd="`basename %d /`"
284 echo -n "Name of the distribution file (without extension) [$Pwd]: "
286 if [ "$tar"x = x ]; then tar="$Pwd"; fi
287 cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
288 echo ../"$tar".tar.lzma created.
291 x Compress the current subdirectory to tar.xz
292 Pwd="`basename %d /`"
293 echo -n "Name of the distribution file (without extension) [$Pwd]: "
295 if [ "$tar"x = x ]; then tar="$Pwd"; fi
296 cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
297 echo ../"$tar".tar.xz created.
300 t Compress the current subdirectory to tar
301 Pwd="`basename %d /`"
302 echo -n "Name of the distribution file (without extension) [$Pwd]: "
304 if [ "$tar"x = x ]; then tar="$Pwd"; fi
305 cd .. && tar cvf - "$Pwd" > "$tar".tar &&
306 echo ../"$tar".tar created.
309 z Compress the current subdirectory to zip
310 Pwd="`basename %d /`"
311 echo -n "Name of the distribution file (without extension) [$Pwd]: "
313 if [ "$zip"x = x ]; then zip="$Pwd"; fi
314 cd .. && zip -r9 "$zip".zip "$Pwd" &&
315 echo ../"$zip".zip created.
318 y Compress the current subdirectory to zip recoding filenames
319 Pwd="`basename %d /`"
320 echo -n "Name of the distribution file (without extension) [$Pwd]: "
322 if [ "$zip"x = x ]; then zip="$Pwd"; fi
323 cd .. && zip.py "$zip".zip "$Pwd" &&
324 echo ../"$zip".zip created.
327 7 Compress the current subdirectory to 7z
328 Pwd="`basename %d /`"
329 echo -n "Name of the distribution file (without extension) [$Pwd]: "
331 if [ "$ar"x = x ]; then ar="$Pwd"; fi
332 cd .. && 7zr a "$ar".7z "$Pwd" &&
333 echo ../"$ar".7z created.
335 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & 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
351 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
352 z 7z the file/directory
355 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
359 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
360 z zip the file/directory
361 exec zip -r9 %f.zip %f
363 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
364 y zip the file/directory recoding filename(s)
365 exec zip.py %f.zip %f
368 Z zip selected files/directories
369 ZIP=%{Enter zip name}
370 exec zip -r9 "$ZIP" %s
373 Y zip selected files/directories recoding filenames
374 ZIP=%{Enter zip name}
375 exec zip.py "$ZIP" %s
377 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
378 n Create a directory for this archive
380 *.tar.Z) D="`basename %f .tar.Z`";;
381 *.tar.bz2) D="`basename %f .tar.bz2`";;
382 *.tar.gz) D="`basename %f .tar.gz`";;
383 *.tbz2) D="`basename %f .tbz2`";;
384 *.tgz) D="`basename %f .tgz`";;
385 *.tz) D="`basename %f .tz`";;
386 *.tar.lz) D="`basename %f .tar.lz`";;
387 *.tar.lzma) D="`basename %f .tar.lzma`";;
388 *.tar.7z) D="`basename %f .tar.7z`";;
389 *.zip) D="`basename %f .zip`";;
390 *.ZIP) D="`basename %f .ZIP`";;
391 *.rar) D="`basename %f .rar`";;
392 *.RAR) D="`basename %f .RAR`";;
393 *.xz) D="`basename %f .xz`";;
394 *.7z) D="`basename %f .7z`";;
398 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
399 N Create a directory for the other archive
401 *.tar.Z) D="`basename %F .tar.Z`";;
402 *.tar.bz2) D="`basename %F .tar.bz2`";;
403 *.tar.gz) D="`basename %F .tar.gz`";;
404 *.tbz2) D="`basename %F .tbz2`";;
405 *.tgz) D="`basename %F .tgz`";;
406 *.tz) D="`basename %F .tz`";;
407 *.tar.lz) D="`basename %F .tar.lz`";;
408 *.tar.lzma) D="`basename %F .tar.lzma`";;
409 *.tar.7z) D="`basename %F .tar.7z`";;
410 *.zip) D="`basename %F .zip`";;
411 *.ZIP) D="`basename %F .ZIP`";;
412 *.rar) D="`basename %F .rar`";;
413 *.RAR) D="`basename %F .RAR`";;
414 *.xz) D="`basename %F .xz`";;
415 *.7z) D="`basename %F .7z`";;
419 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
420 x Extract the contents of a compressed tar file
426 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
447 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
448 X Extract the contents of an other compressed tar file
454 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
473 $PRG %D/%F | tar xvpf -
475 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
476 x Extract a compressed file
478 *.bz2) P="bzip2 -d";;
481 *.lzma) P="lzma -d";;
484 *.tar) P="tar xvpf";;
485 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
486 *.rar|*.RAR) P="unrar x -y";;
490 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
491 X Extract another compressed file
493 *.bz2) P="bzip2 -d";;
496 *.lzma) P="lzma -d";;
499 *.tar) P="tar xvpf";;
500 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
501 *.rar|*.RAR) P="unrar x -y";;
505 + t lr & f \.(zip|ZIP)$
506 y Extract from zip recoding filenames
509 + T r & F \.(zip|ZIP)$
510 Y Extract from other zip recoding filenames
522 C Compare these files
527 exec diff -u --speed-large-files %D/%f %f
531 exec diff -u --speed-large-files %D/%F %f
538 V vimdiff these files
543 exec diff -ru --speed-large-files \
544 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
546 + t d & T d & ! F ^\.\.$
547 D Diff these directories
548 exec diff -ru --speed-large-files \
549 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
551 += f \.(asc|gpg|sig(n)?)$ & t lr
555 + f \.(asc|gpg|sig(n)?)$ & t lr
556 v Verify detached signature
557 exec gpg --verify %f "`echo %f | sed 's/\.[^.]*$//'`"
559 += f \.[1-8]$ | f \.man$ & t lr
560 1 Display the file with roff -man
564 MAN=%{Enter manual name}
565 %view man -P cat $MAN
568 r rsync the file(s) there
569 rsync -ahPv --del %s %D