ScreenLockDetector/create_icon.sh

67 lines
2.2 KiB
Bash
Raw Permalink Normal View History

2025-11-07 14:57:13 +08:00
#!/bin/bash
# 图标生成辅助脚本
# 使用 ImageMagick 创建一个简单的应用图标
set -e
ICON_NAME="icon.png"
ICON_SIZE=256
echo "========================================="
echo "创建应用图标"
echo "========================================="
# 检查 ImageMagick 是否安装
if ! command -v convert &> /dev/null; then
echo "警告: ImageMagick 未安装"
echo "安装命令: sudo apt-get install imagemagick"
echo ""
echo "创建占位图标..."
# 创建一个最小的 PNG 占位符
echo "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDEvMDEvMjSvCNJbAAAA2ElEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOA1Ax+gAAFUfcvqAAAAAElFTkSuQmCC" | base64 -d > "$ICON_NAME"
echo "✓ 占位图标已创建: $ICON_NAME"
exit 0
fi
echo "使用 ImageMagick 创建图标..."
# 创建一个带有锁图标的图像
convert -size ${ICON_SIZE}x${ICON_SIZE} xc:transparent \
-fill "#4A90E2" \
-draw "roundrectangle 30,80 226,226 20,20" \
-fill "#357ABD" \
-draw "roundrectangle 35,85 221,221 15,15" \
-fill "none" \
-stroke "#FFD700" \
-strokewidth 15 \
-draw "arc 70,50 186,120 180,360" \
-fill "#FFD700" \
-draw "rectangle 60,100 196,140" \
-fill "#2C5F8D" \
-draw "circle 128,165 128,185" \
-fill "#2C5F8D" \
-draw "rectangle 118,165 138,200" \
-font DejaVu-Sans-Bold \
-pointsize 24 \
-fill white \
-gravity south \
-annotate +0+20 "SCREEN LOCK" \
"$ICON_NAME"
if [ -f "$ICON_NAME" ]; then
echo "✓ 图标已创建: $ICON_NAME"
echo "尺寸: ${ICON_SIZE}x${ICON_SIZE}"
ls -lh "$ICON_NAME"
else
echo "错误: 图标创建失败"
exit 1
fi
echo ""
echo "如果需要自定义图标,请:"
echo "1. 使用图像编辑软件创建 256x256 的 PNG 图标"
echo "2. 保存为 icon.png"
echo "3. 重新运行打包脚本"