X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.mc%2Fmenu;h=2f605a55660c503320839dbfe3cbcf2801c73334;hb=fbeba601647c48dc0f59af8eac2c50f1acc10ff7;hp=ac3656bfb53253508066717396ccb6ed513d5e31;hpb=dd3715a6b398586302eba94f1f4d29763a2e8ab7;p=dotfiles.git diff --git a/.mc/menu b/.mc/menu index ac3656b..2f605a5 100644 --- a/.mc/menu +++ b/.mc/menu @@ -247,6 +247,15 @@ y Compress the current subdirectory to zip with recoded filenames cd .. && zip.py "$zip".zip "$Pwd" && echo ../"$zip".zip created. ++ t d & f ^\.\.$ +7 Compress the current subdirectory to 7z + Pwd="`basename %d /`" + echo -n "Name of the distribution file (without extension) [$Pwd]: " + read ar + if [ "$ar"x = x ]; then ar="$Pwd"; fi + cd .. && 7zr a "$ar".7z "$Pwd" && + echo ../"$ar".7z created. + + ! f \.bz2$ & ! f \.gz$ & ! f \.lz$ & ! f \.lzma$ & ! f \.7z$ & ! f \.xz$ & ! f \.(zip|ZIP)$ & t r z bzip2 the file exec bzip2 -9 %f @@ -323,36 +332,6 @@ N Create a directory for the other archive esac exec mkdir "$D" -+ f \.(bz2|gz|lz|lzma|7z|xz|tar|zip|ZIP|rar|RAR)$ & t r -x Extract a compressed file - case %f in - *.bz2) P="bzip2 -d";; - *.gz) P="gzip -d";; - *.lz) P="lzip -d";; - *.lzma) P="lzma -d";; - *.7z) P="7zr x";; - *.xz) P="xz -d";; - *.tar) P="tar xvpf";; - *.zip|*.ZIP) P="uzip";; - *.rar|*.RAR) P="rar x -y";; - esac - exec $P %f - -+ F \.(bz2|gz|lz|lzma|7z|xz|tar|zip|ZIP|rar|RAR)$ & T r -X Extract another compressed file - case %F in - *.bz2) P="bzip2 -d";; - *.gz) P="gzip -d";; - *.lz) P="lzip -d";; - *.lzma) P="lzma -d";; - *.7z) P="7zr x";; - *.xz) P="xz -d";; - *.tar) P="tar xvpf";; - *.zip|*.ZIP) P="uzip";; - *.rar|*.RAR) P="rar x -y";; - esac - exec $P %D/%F - + f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lzma$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.tar\.Z$ | f \.tar\.bz2$ & t r x Extract the contents of a compressed tar file unset PRG @@ -409,6 +388,36 @@ X Extract the contents of an other compressed tar file esac $PRG %D/%F | tar xvf - ++ f \.(bz2|gz|lz|lzma|7z|xz|tar|zip|ZIP|rar|RAR)$ & t r +x Extract a compressed file + case %f in + *.bz2) P="bzip2 -d";; + *.gz) P="gzip -d";; + *.lz) P="lzip -d";; + *.lzma) P="lzma -d";; + *.7z) P="7zr x";; + *.xz) P="xz -d";; + *.tar) P="tar xvpf";; + *.zip|*.ZIP) P="unzip";; + *.rar|*.RAR) P="rar x -y";; + esac + exec $P %f + ++ F \.(bz2|gz|lz|lzma|7z|xz|tar|zip|ZIP|rar|RAR)$ & T r +X Extract another compressed file + case %F in + *.bz2) P="bzip2 -d";; + *.gz) P="gzip -d";; + *.lz) P="lzip -d";; + *.lzma) P="lzma -d";; + *.7z) P="7zr x";; + *.xz) P="xz -d";; + *.tar) P="tar xvpf";; + *.zip|*.ZIP) P="unzip";; + *.rar|*.RAR) P="rar x -y";; + esac + exec $P %D/%F + + t r & f \.(zip|ZIP)$ y Extract from zip with recoded filenames exec unzip.py %f