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 cgmem_nice 200 audacious & sleep 3; fi
127 audtool --playlist-addurl "$f"
129 #deadbeef --queue %s &
131 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
132 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
133 p Load the audiofile(s) or playlist(s)
134 if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
135 audtool --playlist-clear
137 audtool --playlist-addurl "$f"
139 #deadbeef --queue %s &
141 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
142 P Play the audiofile(s) or playlist(s)
143 if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
144 audtool --playlist-clear
146 audtool --playlist-addurl "$f"
148 exec audtool --playback-play
149 #mplayer -playlist %f &
153 R Play the playlist in random order
154 "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
155 if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
156 audtool --playlist-clear
157 audtool --playlist-addurl random-playlist-tmp.m3u
158 audtool --playback-play
159 #mplayer -playlist random-playlist-tmp.m3u &
160 #deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
161 (sleep 5; exec rm random-playlist-tmp.m3u) &
163 + 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)$
165 exec "$HOME"/.config/mpv/mpv_identify.sh %f
167 + t d & f (video_ts|VIDEO_TS)$
169 exec "$HOME"/.config/mpv/mpv_identify.sh .
171 + 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
172 m Play video file(s) with mpv
175 + 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
176 m Play video file(s) with mpv (loud)
181 + 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
182 = 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)$
183 m Play video file(s) with mpv (louder)
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 (ask for volume)
190 AUDIO_VOLUME=%{Enter volume}
194 + 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
195 M Play audio/video with mpv GUI
198 += t d & f (video_ts|VIDEO_TS)$
199 d Play DVD directory with mpv
200 mplayer -dvd-device . dvd:// &
202 + t d & f (video_ts|VIDEO_TS)$
203 D Play DVD directory with mpv GUI
204 gmplayer -dvd-device . dvd:// &
206 + t d & f (video_ts|VIDEO_TS)$
207 t Play DVD title with mpv
209 mplayer -dvd-device . dvd://"$title" &
211 + t d & f (video_ts|VIDEO_TS)$
212 T Play DVD title with mpv GUI
214 gmplayer -dvd-device . dvd://"$title" &
217 p Play directory with mpv
221 P Play directory with mpv GUI
225 b Compress the current subdirectory to tar.bz2
226 Pwd="`basename %d /`"
227 echo -n "Name of the distribution file (without extension) [$Pwd]: "
229 if [ "$tar"x = x ]; then tar="$Pwd"; fi
230 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
231 echo ../"$tar".tar.bz2 created.
234 g Compress the current subdirectory to tar.gz
235 Pwd="`basename %d /`"
236 echo -n "Name of the distribution file (without extension) [$Pwd]: "
238 if [ "$tar"x = x ]; then tar="$Pwd"; fi
239 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
240 echo ../"$tar".tar.gz created.
243 l Compress the current subdirectory to tar.lzma
244 Pwd="`basename %d /`"
245 echo -n "Name of the distribution file (without extension) [$Pwd]: "
247 if [ "$tar"x = x ]; then tar="$Pwd"; fi
248 cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
249 echo ../"$tar".tar.lzma created.
252 x Compress the current subdirectory to tar.xz
253 Pwd="`basename %d /`"
254 echo -n "Name of the distribution file (without extension) [$Pwd]: "
256 if [ "$tar"x = x ]; then tar="$Pwd"; fi
257 cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
258 echo ../"$tar".tar.xz created.
261 t Compress the current subdirectory to tar
262 Pwd="`basename %d /`"
263 echo -n "Name of the distribution file (without extension) [$Pwd]: "
265 if [ "$tar"x = x ]; then tar="$Pwd"; fi
266 cd .. && tar cvf - "$Pwd" > "$tar".tar &&
267 echo ../"$tar".tar created.
270 z Compress the current subdirectory to zip
271 Pwd="`basename %d /`"
272 echo -n "Name of the distribution file (without extension) [$Pwd]: "
274 if [ "$zip"x = x ]; then zip="$Pwd"; fi
275 cd .. && zip -r9 "$zip".zip "$Pwd" &&
276 echo ../"$zip".zip created.
279 y Compress the current subdirectory to zip recoding filenames
280 Pwd="`basename %d /`"
281 echo -n "Name of the distribution file (without extension) [$Pwd]: "
283 if [ "$zip"x = x ]; then zip="$Pwd"; fi
284 cd .. && zip.py "$zip".zip "$Pwd" &&
285 echo ../"$zip".zip created.
288 7 Compress the current subdirectory to 7z
289 Pwd="`basename %d /`"
290 echo -n "Name of the distribution file (without extension) [$Pwd]: "
292 if [ "$ar"x = x ]; then ar="$Pwd"; fi
293 cd .. && 7zr a "$ar".7z "$Pwd" &&
294 echo ../"$ar".7z created.
296 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
300 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
304 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
308 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
312 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
313 z 7z the file/directory
316 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
320 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
321 z zip the file/directory
322 exec zip -r9 %f.zip %f
324 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
325 y zip the file/directory recoding filename(s)
326 exec zip.py %f.zip %f
329 Z zip selected files/directories
330 ZIP=%{Enter zip name}
331 exec zip -r9 "$ZIP" %s
334 Y zip selected files/directories recoding filenames
335 ZIP=%{Enter zip name}
336 exec zip.py "$ZIP" %s
338 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
339 n Create a directory for this archive
341 *.tar.Z) D="`basename %f .tar.Z`";;
342 *.tar.bz2) D="`basename %f .tar.bz2`";;
343 *.tar.gz) D="`basename %f .tar.gz`";;
344 *.tbz2) D="`basename %f .tbz2`";;
345 *.tgz) D="`basename %f .tgz`";;
346 *.tz) D="`basename %f .tz`";;
347 *.tar.lz) D="`basename %f .tar.lz`";;
348 *.tar.lzma) D="`basename %f .tar.lzma`";;
349 *.tar.7z) D="`basename %f .tar.7z`";;
350 *.zip) D="`basename %f .zip`";;
351 *.ZIP) D="`basename %f .ZIP`";;
352 *.rar) D="`basename %f .rar`";;
353 *.RAR) D="`basename %f .RAR`";;
354 *.xz) D="`basename %f .xz`";;
355 *.7z) D="`basename %f .7z`";;
359 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
360 N Create a directory for the other 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|7z|xz))|(tbz2|tgz|tz)$ & t lr
381 x Extract the contents of a compressed tar file
387 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
408 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
409 X Extract the contents of an other compressed tar file
415 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
434 $PRG %D/%F | tar xvpf -
436 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
437 x Extract a compressed file
439 *.bz2) P="bzip2 -d";;
442 *.lzma) P="lzma -d";;
445 *.tar) P="tar xvpf";;
446 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
447 *.rar|*.RAR) P="unrar x -y";;
451 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
452 X Extract another compressed file
454 *.bz2) P="bzip2 -d";;
457 *.lzma) P="lzma -d";;
460 *.tar) P="tar xvpf";;
461 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
462 *.rar|*.RAR) P="unrar x -y";;
466 + t lr & f \.(zip|ZIP)$
467 y Extract from zip recoding filenames
470 + T r & F \.(zip|ZIP)$
471 Y Extract from other zip recoding filenames
483 C Compare these files
488 exec diff -u --speed-large-files %D/%f %f
492 exec diff -u --speed-large-files %D/%F %f
499 V vimdiff these files
504 exec diff -ru --speed-large-files \
505 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
507 + t d & T d & ! F ^\.\.$
508 D Diff these directories
509 exec diff -ru --speed-large-files \
510 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
512 += f \.(asc|gpg|sig(n)?)$ & t lr
516 += f \.[1-8]$ | f \.man$ & t lr
517 1 Display the file with roff -man
521 MAN=%{Enter manual name}
522 %view man -P cat $MAN
525 r rsync the file(s) there
526 rsync -ahPv --del %s %D