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)$ | t t
106 = t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
107 i View image(s) scaled
108 xli -title "`echo %s | sed 's/ /_/g'`" -zoom auto %s &
110 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
111 I View image(s) full size
112 xli -title "`echo %s | sed 's/ /_/g'`" %s &
114 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
118 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$ | t t
119 = t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
120 I View icon, JPEG-2000, TIFF, WebP image
123 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
127 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
128 a Add the audiofile(s) or playlist(s)
129 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
132 *.m3u) while read song; do
133 audtool --playlist-addurl "$song"
135 *) audtool --playlist-addurl "$f" ;;
138 #deadbeef --queue %s &
140 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
141 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
142 p Load the audiofile(s) or playlist(s)
143 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
144 audtool --playlist-clear
147 *.m3u) while read song; do
148 audtool --playlist-addurl "$song"
150 *) audtool --playlist-addurl "$f" ;;
153 #deadbeef --queue %s &
155 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
156 P Play the audiofile(s) or playlist(s)
157 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
158 audtool --playlist-clear
161 *.m3u) while read song; do
162 audtool --playlist-addurl "$song"
164 *) audtool --playlist-addurl "$f" ;;
167 exec audtool --playback-play
168 #mplayer -playlist %f &
172 R Play the playlist in random order
173 "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
174 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
175 audtool --playlist-clear
177 audtool --playlist-addurl "$song"
178 done < random-playlist-tmp.m3u
179 audtool --playback-play
180 #mplayer -playlist random-playlist-tmp.m3u &
181 #deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
182 (sleep 5; exec rm random-playlist-tmp.m3u) &
184 + 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)$
186 exec "$HOME"/.config/mpv/mpv_identify.sh %f
188 + t d & f (video_ts|VIDEO_TS)$
190 exec "$HOME"/.config/mpv/mpv_identify.sh .
192 + 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
193 m Play video file(s) with mpv
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 (loud)
202 + 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
203 = 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)$
204 m Play video file(s) with mpv (louder)
209 + 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
210 m Play video file(s) with mpv (ask for volume)
211 AUDIO_VOLUME=%{Enter volume}
215 + 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
216 M Play audio/video with mpv GUI
219 += t d & f (video_ts|VIDEO_TS)$
220 d Play DVD directory with mpv
221 mplayer -dvd-device . dvd:// &
223 + t d & f (video_ts|VIDEO_TS)$
224 D Play DVD directory with mpv GUI
225 gmplayer -dvd-device . dvd:// &
227 + t d & f (video_ts|VIDEO_TS)$
228 t Play DVD title with mpv
230 mplayer -dvd-device . dvd://"$title" &
232 + t d & f (video_ts|VIDEO_TS)$
233 T Play DVD title with mpv GUI
235 gmplayer -dvd-device . dvd://"$title" &
238 p Play directory with mpv
242 P Play directory with mpv GUI
246 b Compress the current subdirectory to tar.bz2
247 Pwd="`basename %d /`"
248 echo -n "Name of the distribution file (without extension) [$Pwd]: "
250 if [ "$tar"x = x ]; then tar="$Pwd"; fi
251 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
252 echo ../"$tar".tar.bz2 created.
255 g Compress the current subdirectory to tar.gz
256 Pwd="`basename %d /`"
257 echo -n "Name of the distribution file (without extension) [$Pwd]: "
259 if [ "$tar"x = x ]; then tar="$Pwd"; fi
260 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
261 echo ../"$tar".tar.gz created.
264 l Compress the current subdirectory to tar.lzma
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" | lzma -f9 > "$tar".tar.lzma &&
270 echo ../"$tar".tar.lzma created.
273 x Compress the current subdirectory to tar.xz
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" | xz -f9 > "$tar".tar.xz &&
279 echo ../"$tar".tar.xz created.
282 t Compress the current subdirectory to tar
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" > "$tar".tar &&
288 echo ../"$tar".tar created.
291 z Compress the current subdirectory to zip
292 Pwd="`basename %d /`"
293 echo -n "Name of the distribution file (without extension) [$Pwd]: "
295 if [ "$zip"x = x ]; then zip="$Pwd"; fi
296 cd .. && zip -r9 "$zip".zip "$Pwd" &&
297 echo ../"$zip".zip created.
300 y Compress the current subdirectory to zip recoding filenames
301 Pwd="`basename %d /`"
302 echo -n "Name of the distribution file (without extension) [$Pwd]: "
304 if [ "$zip"x = x ]; then zip="$Pwd"; fi
305 cd .. && zip.py "$zip".zip "$Pwd" &&
306 echo ../"$zip".zip created.
309 7 Compress the current subdirectory to 7z
310 Pwd="`basename %d /`"
311 echo -n "Name of the distribution file (without extension) [$Pwd]: "
313 if [ "$ar"x = x ]; then ar="$Pwd"; fi
314 cd .. && 7zr a "$ar".7z "$Pwd" &&
315 echo ../"$ar".7z created.
317 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
321 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & 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
334 z 7z the file/directory
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 zip the file/directory
343 exec zip -r9 %f.zip %f
345 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
346 y zip the file/directory recoding filename(s)
347 exec zip.py %f.zip %f
350 Z zip selected files/directories
351 ZIP=%{Enter zip name}
352 exec zip -r9 "$ZIP" %s
355 Y zip selected files/directories recoding filenames
356 ZIP=%{Enter zip name}
357 exec zip.py "$ZIP" %s
359 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
360 n Create a directory for this archive
362 *.tar.Z) D="`basename %f .tar.Z`";;
363 *.tar.bz2) D="`basename %f .tar.bz2`";;
364 *.tar.gz) D="`basename %f .tar.gz`";;
365 *.tbz2) D="`basename %f .tbz2`";;
366 *.tgz) D="`basename %f .tgz`";;
367 *.tz) D="`basename %f .tz`";;
368 *.tar.lz) D="`basename %f .tar.lz`";;
369 *.tar.lzma) D="`basename %f .tar.lzma`";;
370 *.tar.7z) D="`basename %f .tar.7z`";;
371 *.zip) D="`basename %f .zip`";;
372 *.ZIP) D="`basename %f .ZIP`";;
373 *.rar) D="`basename %f .rar`";;
374 *.RAR) D="`basename %f .RAR`";;
375 *.xz) D="`basename %f .xz`";;
376 *.7z) D="`basename %f .7z`";;
380 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
381 N Create a directory for the other archive
383 *.tar.Z) D="`basename %F .tar.Z`";;
384 *.tar.bz2) D="`basename %F .tar.bz2`";;
385 *.tar.gz) D="`basename %F .tar.gz`";;
386 *.tbz2) D="`basename %F .tbz2`";;
387 *.tgz) D="`basename %F .tgz`";;
388 *.tz) D="`basename %F .tz`";;
389 *.tar.lz) D="`basename %F .tar.lz`";;
390 *.tar.lzma) D="`basename %F .tar.lzma`";;
391 *.tar.7z) D="`basename %F .tar.7z`";;
392 *.zip) D="`basename %F .zip`";;
393 *.ZIP) D="`basename %F .ZIP`";;
394 *.rar) D="`basename %F .rar`";;
395 *.RAR) D="`basename %F .RAR`";;
396 *.xz) D="`basename %F .xz`";;
397 *.7z) D="`basename %F .7z`";;
401 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
402 x Extract the contents of a compressed tar file
408 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
429 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
430 X Extract the contents of an other compressed tar file
436 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
455 $PRG %D/%F | tar xvpf -
457 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
458 x Extract a compressed file
460 *.bz2) P="bzip2 -d";;
463 *.lzma) P="lzma -d";;
466 *.tar) P="tar xvpf";;
467 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
468 *.rar|*.RAR) P="unrar x -y";;
472 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
473 X Extract another compressed file
475 *.bz2) P="bzip2 -d";;
478 *.lzma) P="lzma -d";;
481 *.tar) P="tar xvpf";;
482 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
483 *.rar|*.RAR) P="unrar x -y";;
487 + t lr & f \.(zip|ZIP)$
488 y Extract from zip recoding filenames
491 + T r & F \.(zip|ZIP)$
492 Y Extract from other zip recoding filenames
504 C Compare these files
509 exec diff -u --speed-large-files %D/%f %f
513 exec diff -u --speed-large-files %D/%F %f
520 V vimdiff these files
525 exec diff -ru --speed-large-files \
526 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
528 + t d & T d & ! F ^\.\.$
529 D Diff these directories
530 exec diff -ru --speed-large-files \
531 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
533 += f \.(asc|gpg|sig(n)?)$ & t lr
537 += f \.[1-8]$ | f \.man$ & t lr
538 1 Display the file with roff -man
542 MAN=%{Enter manual name}
543 %view man -P cat $MAN
546 r rsync the file(s) there
547 rsync -ahPv --del %s %D