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 \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
124 a Add the audiofile(s) or playlist(s)
125 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
128 *.m3u) while read song; do
129 audtool --playlist-addurl "$song"
131 *) audtool --playlist-addurl "$f" ;;
134 #deadbeef --queue %s &
136 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
137 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
138 p Load the audiofile(s) or playlist(s)
139 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
140 audtool --playlist-clear
143 *.m3u) while read song; do
144 audtool --playlist-addurl "$song"
146 *) audtool --playlist-addurl "$f" ;;
149 #deadbeef --queue %s &
151 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
152 P Play the audiofile(s) or playlist(s)
153 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
154 audtool --playlist-clear
157 *.m3u) while read song; do
158 audtool --playlist-addurl "$song"
160 *) audtool --playlist-addurl "$f" ;;
163 exec audtool --playback-play
164 #mplayer -playlist %f &
168 R Play the playlist in random order
169 "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f /tmp/random-playlist-tmp.m3u
170 if [ "`audtool --get-volume`" -eq 0 ]; then audacious & sleep 3; fi
171 audtool --playlist-clear
173 audtool --playlist-addurl "$song"
174 done < /tmp/random-playlist-tmp.m3u
175 audtool --playback-play
176 #mplayer -playlist random-playlist-tmp.m3u &
177 #deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
178 (sleep 5; exec rm /tmp/random-playlist-tmp.m3u) &
180 + 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)$
182 exec "$HOME"/.config/mpv/mpv_identify.sh %f
184 + t d & f (video_ts|VIDEO_TS)$
186 exec "$HOME"/.config/mpv/mpv_identify.sh .
188 + 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
189 m Play video file(s) with mpv
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 (loud)
198 + 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
199 = 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)$
200 m Play video file(s) with mpv (louder)
205 + 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
206 m Play video file(s) with mpv (ask for volume)
207 AUDIO_VOLUME=%{Enter volume}
211 + 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
212 M Play audio/video with mpv GUI
215 += t d & f (video_ts|VIDEO_TS)$
216 d Play DVD directory with mpv
217 mplayer -dvd-device . dvd:// &
219 + t d & f (video_ts|VIDEO_TS)$
220 D Play DVD directory with mpv GUI
221 gmplayer -dvd-device . dvd:// &
223 + t d & f (video_ts|VIDEO_TS)$
224 t Play DVD title with mpv
226 mplayer -dvd-device . dvd://"$title" &
228 + t d & f (video_ts|VIDEO_TS)$
229 T Play DVD title with mpv GUI
231 gmplayer -dvd-device . dvd://"$title" &
234 p Play directory with mpv
238 P Play directory with mpv GUI
242 b Compress the current subdirectory to tar.bz2
243 Pwd="`basename %d /`"
244 echo -n "Name of the distribution file (without extension) [$Pwd]: "
246 if [ "$tar"x = x ]; then tar="$Pwd"; fi
247 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
248 echo ../"$tar".tar.bz2 created.
251 g Compress the current subdirectory to tar.gz
252 Pwd="`basename %d /`"
253 echo -n "Name of the distribution file (without extension) [$Pwd]: "
255 if [ "$tar"x = x ]; then tar="$Pwd"; fi
256 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
257 echo ../"$tar".tar.gz created.
260 l Compress the current subdirectory to tar.lzma
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" | lzma -f9 > "$tar".tar.lzma &&
266 echo ../"$tar".tar.lzma created.
269 x Compress the current subdirectory to tar.xz
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" | xz -f9 > "$tar".tar.xz &&
275 echo ../"$tar".tar.xz created.
278 t Compress the current subdirectory to tar
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" > "$tar".tar &&
284 echo ../"$tar".tar created.
287 z Compress the current subdirectory to zip
288 Pwd="`basename %d /`"
289 echo -n "Name of the distribution file (without extension) [$Pwd]: "
291 if [ "$zip"x = x ]; then zip="$Pwd"; fi
292 cd .. && zip -r9 "$zip".zip "$Pwd" &&
293 echo ../"$zip".zip created.
296 y Compress the current subdirectory to zip recoding filenames
297 Pwd="`basename %d /`"
298 echo -n "Name of the distribution file (without extension) [$Pwd]: "
300 if [ "$zip"x = x ]; then zip="$Pwd"; fi
301 cd .. && zip.py "$zip".zip "$Pwd" &&
302 echo ../"$zip".zip created.
305 7 Compress the current subdirectory to 7z
306 Pwd="`basename %d /`"
307 echo -n "Name of the distribution file (without extension) [$Pwd]: "
309 if [ "$ar"x = x ]; then ar="$Pwd"; fi
310 cd .. && 7zr a "$ar".7z "$Pwd" &&
311 echo ../"$ar".7z created.
313 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
317 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & 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
330 z 7z the file/directory
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 zip the file/directory
339 exec zip -r9 %f.zip %f
341 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
342 y zip the file/directory recoding filename(s)
343 exec zip.py %f.zip %f
346 Z zip selected files/directories
347 ZIP=%{Enter zip name}
348 exec zip -r9 "$ZIP" %s
351 Y zip selected files/directories recoding filenames
352 ZIP=%{Enter zip name}
353 exec zip.py "$ZIP" %s
355 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
356 n Create a directory for this archive
358 *.tar.Z) D="`basename %f .tar.Z`";;
359 *.tar.bz2) D="`basename %f .tar.bz2`";;
360 *.tar.gz) D="`basename %f .tar.gz`";;
361 *.tbz2) D="`basename %f .tbz2`";;
362 *.tgz) D="`basename %f .tgz`";;
363 *.tz) D="`basename %f .tz`";;
364 *.tar.lz) D="`basename %f .tar.lz`";;
365 *.tar.lzma) D="`basename %f .tar.lzma`";;
366 *.tar.7z) D="`basename %f .tar.7z`";;
367 *.zip) D="`basename %f .zip`";;
368 *.ZIP) D="`basename %f .ZIP`";;
369 *.rar) D="`basename %f .rar`";;
370 *.RAR) D="`basename %f .RAR`";;
371 *.xz) D="`basename %f .xz`";;
372 *.7z) D="`basename %f .7z`";;
376 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
377 N Create a directory for the other archive
379 *.tar.Z) D="`basename %F .tar.Z`";;
380 *.tar.bz2) D="`basename %F .tar.bz2`";;
381 *.tar.gz) D="`basename %F .tar.gz`";;
382 *.tbz2) D="`basename %F .tbz2`";;
383 *.tgz) D="`basename %F .tgz`";;
384 *.tz) D="`basename %F .tz`";;
385 *.tar.lz) D="`basename %F .tar.lz`";;
386 *.tar.lzma) D="`basename %F .tar.lzma`";;
387 *.tar.7z) D="`basename %F .tar.7z`";;
388 *.zip) D="`basename %F .zip`";;
389 *.ZIP) D="`basename %F .ZIP`";;
390 *.rar) D="`basename %F .rar`";;
391 *.RAR) D="`basename %F .RAR`";;
392 *.xz) D="`basename %F .xz`";;
393 *.7z) D="`basename %F .7z`";;
397 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
398 x Extract the contents of a compressed tar file
404 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
425 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
426 X Extract the contents of an other compressed tar file
432 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
451 $PRG %D/%F | tar xvpf -
453 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
454 x Extract a compressed file
456 *.bz2) P="bzip2 -d";;
459 *.lzma) P="lzma -d";;
462 *.tar) P="tar xvpf";;
463 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
464 *.rar|*.RAR) P="unrar x -y";;
468 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
469 X Extract another compressed file
471 *.bz2) P="bzip2 -d";;
474 *.lzma) P="lzma -d";;
477 *.tar) P="tar xvpf";;
478 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
479 *.rar|*.RAR) P="unrar x -y";;
483 + t lr & f \.(zip|ZIP)$
484 y Extract from zip recoding filenames
487 + T r & F \.(zip|ZIP)$
488 Y Extract from other zip recoding filenames
500 C Compare these files
505 exec diff -u --speed-large-files %D/%f %f
509 exec diff -u --speed-large-files %D/%F %f
516 V vimdiff these files
521 exec diff -ru --speed-large-files \
522 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
524 + t d & T d & ! F ^\.\.$
525 D Diff these directories
526 exec diff -ru --speed-large-files \
527 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
529 += f \.(asc|gpg|sig(n)?)$ & t lr
533 += f \.[1-8]$ | f \.man$ & t lr
534 1 Display the file with roff -man
538 MAN=%{Enter manual name}
539 %view man -P cat $MAN
542 r rsync the file(s) there
543 rsync -ahPv --del %s %D