UBUNTU14.04下nautilus脚本解压含中文ZIP文件插件

通常用unzip命令解压含中文乱码的文件以下:shell

unzip -O CP936 含中文文件名.zipbash

每次都这样作那太累,因此写了个小插件配合nautilus方便平常办公使用:插件

打开 ~/.local/share/nautilus/scripts/目录,新建“解压中文zip文件”code

内容以下:ip

#!/bin/bash
#@author wiki charmfocus@gmail.com
(for File in "$@"
do
if [ -d "$File" ]; then
zenity --error --text="'$File' 是个目录."
exit
fi
unzip -O CP936 "$File"
done)|zenity --progress \
--title="解压含中文的ZIP文件" \
--text="正在解压..." \
--percentage=0 \
--auto-close \
--pulsate
if [ "$?" = -1 ] ; then
  zenity --error \
    --text="解压失败."
fi

加上可执行权限:it

chmod +x 解压中文zip文件

而后右击中文内容的ZIP文件,右键菜单->脚本->解压中文zip文件class

相关文章
相关标签/搜索