前言
每次制作mac的icns图标时都非常麻烦,需要执行一大段命令,索性就封装成一个shell轻快
效果如下

脚本内容
#!/bin/bash
# @Author: 鲁恺文
# @Email: kevinlu98@qq.com
# @Date: 2021-08-31 14:08
# @Desc:
#
if [ $# -eq 0 ];
then
echo 请输入参数[input]!
exit
fi
input=$1
if [ -f $input ];then
echo "输入文件为$input"
else
echo "文件\"$input\"不存在"
fi
temp_dir=${input%.*}.iconset
mkdir $temp_dir
sizes=(16 32 64 128 256 512 1024)
for size in ${sizes[@]};
do
echo "正在生成${size}x${size}的图标..."
sips -z $size $size $input --out $temp_dir/icon_${size}x${size}.png
done
echo "所有尺寸图标生成成功!"
echo "正在合成icns图标..."
output=${input%.*}.icns
iconutil -c icns $temp_dir -o $output
rm -fr $temp_dir
echo "图标合成成功!\n输出路径为\"$output\""
下载看看
I drop a comment whenever I like a article on a site or I have something to valuable to contribute to the discussion. Usually it is a result of the fire displayed in the article I looked at. And on this article Freewind主题音乐播放器(老王重制版) - 冷文学习者. I was actually excited enough to post a comment :-) I actually do have a few questions for you if it's okay. Could it be just me or do some of these responses appear like left by brain dead people? :-P And, if you are posting at other places, I would like to keep up with everything new you have to post. Could you list the complete urls of your communal sites like your linkedin profile, Facebook page or twitter feed? Feel free to surf to my blog post :: https://bonusstats.com/en/bonus-7signs
Thanks for finally talking about >Freewind 1.5 更新 - 冷文学习者
下载看看
我要回复一下课件