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|ps|PS)(\.bz2|\.gz)?$
65 e View pdf/ps with qpdfview
66 qpdfview "`echo \"%f\" | sed 's/\\\\//g' | iconv -t utf-8`" &
68 += t lr & f \.djvu(\.bz2|\.gz)?$
72 += t lr & f \.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
73 o View OpenDoc with odt2txt
74 odt2txt %f | ${PAGER:-more}
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 \.(doc|DOC|rtf)$
81 d View doc with catdoc
82 catdoc %f | ${PAGER:-more}
84 += t lr & f \.(docx|DOCX)$
85 d View docx with docx2txt
86 docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
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 \.(xls|XLS)$
94 x View xls with xls2csv
95 xls2csv %f | ${PAGER:-more}
97 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
98 = t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
99 i View image(s) scaled
100 xli -title "`echo %s | sed 's/ /_/g'`" -zoom auto %s &
102 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$ | t t
103 I View image(s) full size
104 xli -title "`echo %s | sed 's/ /_/g'`" %s &
106 + t lr & f \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|pbm|PBM|ppm|PPM|png|PNG|xbm|xpm)$
110 + t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$ | t t
111 = t lr & f \.(ico|jp2|tif|TIF|tiff|TIFF|webp)$
112 I View icon, JPEG-2000, TIFF, WebP image
115 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
116 a Add the audiofile(s) or playlist(s)
117 if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
119 audtool --playlist-addurl "$f"
121 #smplay -add-to-playlist %s &
122 #deadbeef --queue %s &
124 + t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$ | t t
125 = t lr & f \.(aac|ac3|ape|cue|dts|flac|m3u|mka|mp3|MP3|ogg|OGG|pls|WAV|wav|wv)$
126 p Load the audiofile(s) or playlist(s)
127 if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
128 audtool --playlist-clear
130 audtool --playlist-addurl "$f"
132 #smplayer -send-action pl_remove_all
133 #smplay -add-to-playlist %s &
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 P Play the audiofile(s) or playlist(s)
138 if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
139 audtool --playlist-clear
141 audtool --playlist-addurl "$f"
143 exec audtool --playback-play
144 #mplayer -playlist %f &
147 #exec mediaplayer_open %f
150 R Play the playlist in random order
151 "$HOME"/admin/prog/audio-cdr-video/audio/shuffle-playlist.py %f random-playlist-tmp.m3u
152 if [ "`audtool --get-volume`" -eq 0 ]; then cgmem_nice 200 audacious & sleep 3; fi
153 audtool --playlist-clear
154 audtool --playlist-addurl random-playlist-tmp.m3u
155 audtool --playback-play
156 #mplayer -playlist random-playlist-tmp.m3u &
157 #smplay random-playlist-tmp.m3u &
158 #smplay -actions pl_shuffle %f &
159 #deadbeef --queue random-playlist-tmp.m3u & deadbeef --play
160 #mediaplayer_open random-playlist-tmp.m3u
161 (sleep 5; exec rm random-playlist-tmp.m3u) &
163 + 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
164 s Play audio/video file(s) or directory with smplayer
167 + t d & f (video_ts|VIDEO_TS)$
168 c Play the current directory with smplayer
171 + 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)$
173 exec "$HOME"/.config/mpv/mpv_identify.sh %f
175 + t d & f (video_ts|VIDEO_TS)$
177 exec "$HOME"/.config/mpv/mpv_identify.sh .
179 + 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
180 = 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)$
181 m Play video file(s) with mpv
184 + 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
185 = 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)$
186 m Play video file(s) with mpv asking audio volume
187 AUDIO_VOLUME=%{Enter volume}
191 + 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
192 M Play audio/video with mpv GUI
195 += t d & f (video_ts|VIDEO_TS)$
196 d Play DVD directory with mpv
197 mplayer -dvd-device . dvd:// &
199 + t d & f (video_ts|VIDEO_TS)$
200 D Play DVD directory with mpv GUI
201 gmplay -dvd-device . dvd:// &
203 + t d & f (video_ts|VIDEO_TS)$
204 t Play DVD title with mpv
206 mplayer -dvd-device . dvd://"$title" &
208 + t d & f (video_ts|VIDEO_TS)$
209 T Play DVD title with mpv GUI
211 gmplay -dvd-device . dvd://"$title" &
214 p Play directory with mpv
218 P Play directory with mpv GUI
222 b Compress the current subdirectory to tar.bz2
223 Pwd="`basename %d /`"
224 echo -n "Name of the distribution file (without extension) [$Pwd]: "
226 if [ "$tar"x = x ]; then tar="$Pwd"; fi
227 cd .. && tar cvf - "$Pwd" | bzip2 -f9 > "$tar".tar.bz2 &&
228 echo ../"$tar".tar.bz2 created.
231 g Compress the current subdirectory to tar.gz
232 Pwd="`basename %d /`"
233 echo -n "Name of the distribution file (without extension) [$Pwd]: "
235 if [ "$tar"x = x ]; then tar="$Pwd"; fi
236 cd .. && tar cvf - "$Pwd" | gzip -f9 > "$tar".tar.gz &&
237 echo ../"$tar".tar.gz created.
240 l Compress the current subdirectory to tar.lzma
241 Pwd="`basename %d /`"
242 echo -n "Name of the distribution file (without extension) [$Pwd]: "
244 if [ "$tar"x = x ]; then tar="$Pwd"; fi
245 cd .. && tar cvf - "$Pwd" | lzma -f9 > "$tar".tar.lzma &&
246 echo ../"$tar".tar.lzma created.
249 x Compress the current subdirectory to tar.xz
250 Pwd="`basename %d /`"
251 echo -n "Name of the distribution file (without extension) [$Pwd]: "
253 if [ "$tar"x = x ]; then tar="$Pwd"; fi
254 cd .. && tar cvf - "$Pwd" | xz -f9 > "$tar".tar.xz &&
255 echo ../"$tar".tar.xz created.
258 t Compress the current subdirectory to tar
259 Pwd="`basename %d /`"
260 echo -n "Name of the distribution file (without extension) [$Pwd]: "
262 if [ "$tar"x = x ]; then tar="$Pwd"; fi
263 cd .. && tar cvf - "$Pwd" > "$tar".tar &&
264 echo ../"$tar".tar created.
267 z Compress the current subdirectory to zip
268 Pwd="`basename %d /`"
269 echo -n "Name of the distribution file (without extension) [$Pwd]: "
271 if [ "$zip"x = x ]; then zip="$Pwd"; fi
272 cd .. && zip -r9 "$zip".zip "$Pwd" &&
273 echo ../"$zip".zip created.
276 y Compress the current subdirectory to zip recoding filenames
277 Pwd="`basename %d /`"
278 echo -n "Name of the distribution file (without extension) [$Pwd]: "
280 if [ "$zip"x = x ]; then zip="$Pwd"; fi
281 cd .. && zip.py "$zip".zip "$Pwd" &&
282 echo ../"$zip".zip created.
285 7 Compress the current subdirectory to 7z
286 Pwd="`basename %d /`"
287 echo -n "Name of the distribution file (without extension) [$Pwd]: "
289 if [ "$ar"x = x ]; then ar="$Pwd"; fi
290 cd .. && 7zr a "$ar".7z "$Pwd" &&
291 echo ../"$ar".7z created.
293 + ! f \.(bz2|gz|lz|lzma|7z|xz|zip|ZIP)$ & t lr
297 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
301 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
305 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
309 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
310 z 7z the file/directory
313 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
317 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
318 z zip the file/directory
319 exec zip -r9 %f.zip %f
321 + ! f \.(z|Z|bz2|gz|lz|lzma)|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
322 y zip the file/directory recoding filename(s)
323 exec zip.py %f.zip %f
326 Z zip selected files/directories
327 ZIP=%{Enter zip name}
328 exec zip -r9 "$ZIP" %s
331 Y zip selected files/directories recoding filenames
332 ZIP=%{Enter zip name}
333 exec zip.py "$ZIP" %s
335 + f \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & t lr
336 n Create a directory for this archive
338 *.tar.Z) D="`basename %f .tar.Z`";;
339 *.tar.bz2) D="`basename %f .tar.bz2`";;
340 *.tar.gz) D="`basename %f .tar.gz`";;
341 *.tbz2) D="`basename %f .tbz2`";;
342 *.tgz) D="`basename %f .tgz`";;
343 *.tz) D="`basename %f .tz`";;
344 *.tar.lz) D="`basename %f .tar.lz`";;
345 *.tar.lzma) D="`basename %f .tar.lzma`";;
346 *.tar.7z) D="`basename %f .tar.7z`";;
347 *.zip) D="`basename %f .zip`";;
348 *.ZIP) D="`basename %f .ZIP`";;
349 *.rar) D="`basename %f .rar`";;
350 *.RAR) D="`basename %f .RAR`";;
351 *.xz) D="`basename %f .xz`";;
352 *.7z) D="`basename %f .7z`";;
356 + F \.(tar\.(z|Z|bz2|gz|lz|lzma))|(tbz2|tgz|tz|zip|ZIP|rar|RAR|xz|7z)$ & T r
357 N Create a directory for the other archive
359 *.tar.Z) D="`basename %F .tar.Z`";;
360 *.tar.bz2) D="`basename %F .tar.bz2`";;
361 *.tar.gz) D="`basename %F .tar.gz`";;
362 *.tbz2) D="`basename %F .tbz2`";;
363 *.tgz) D="`basename %F .tgz`";;
364 *.tz) D="`basename %F .tz`";;
365 *.tar.lz) D="`basename %F .tar.lz`";;
366 *.tar.lzma) D="`basename %F .tar.lzma`";;
367 *.tar.7z) D="`basename %F .tar.7z`";;
368 *.zip) D="`basename %F .zip`";;
369 *.ZIP) D="`basename %F .ZIP`";;
370 *.rar) D="`basename %F .rar`";;
371 *.RAR) D="`basename %F .RAR`";;
372 *.xz) D="`basename %F .xz`";;
373 *.7z) D="`basename %F .7z`";;
377 + f \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & t lr
378 x Extract the contents of a compressed tar file
384 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
405 + F \.(tar\.(z|Z|bz2|gz|lz|lzma|7z|xz))|(tbz2|tgz|tz)$ & T r
406 X Extract the contents of an other compressed tar file
412 *.tar.gz|*.tar.z|*.tgz|*.tz|*.tar.Z)
431 $PRG %D/%F | tar xvpf -
433 + f \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & t lr
434 x Extract a compressed file
436 *.bz2) P="bzip2 -d";;
439 *.lzma) P="lzma -d";;
442 *.tar) P="tar xvpf";;
443 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
444 *.rar|*.RAR) P="unrar x -y";;
448 + F \.(bz2|egg|gz|lz|lzma|7z|xz|tar|whl|zip|ZIP|rar|RAR)$ & T r
449 X Extract another compressed file
451 *.bz2) P="bzip2 -d";;
454 *.lzma) P="lzma -d";;
457 *.tar) P="tar xvpf";;
458 *.egg|*.whl|*.zip|*.ZIP) P="unzip";;
459 *.rar|*.RAR) P="unrar x -y";;
463 + t lr & f \.(zip|ZIP)$
464 y Extract from zip recoding filenames
467 + T r & F \.(zip|ZIP)$
468 Y Extract from other zip recoding filenames
480 C Compare these files
485 exec diff -u --speed-large-files %D/%f %f
489 exec diff -u --speed-large-files %D/%F %f
496 V vimdiff these files
501 exec diff -ru --speed-large-files \
502 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%f %f
504 + t d & T d & ! F ^\.\.$
505 D Diff these directories
506 exec diff -ru --speed-large-files \
507 -x CVS -x .git -x .hg -x .svn -x '*.py[co]' -x __pycache__ %D/%F %f
509 += f \.(asc|gpg|sig(n)?)$ & t lr
513 += f \.[1-8]$ | f \.man$ & t lr
514 1 Display the file with roff -man
518 MAN=%{Enter manual name}
519 %view man -P cat $MAN
522 r rsync the file(s) there
523 rsync -ahPv --del %s %D