Update AO notifier app icon

This commit is contained in:
whoisasx 2026-05-14 11:42:00 +05:30
parent bd1fa42c61
commit 9d802b5555
3 changed files with 68 additions and 2 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -15,6 +15,7 @@
},
"files": [
"dist",
"assets",
"src",
"scripts"
],

View File

@ -15,6 +15,7 @@ const macOsDir = resolve(contentsDir, "MacOS");
const resourcesDir = resolve(contentsDir, "Resources");
const executablePath = resolve(macOsDir, "ao-notifier");
const swiftSource = resolve(packageDir, "src", "AONotifier.swift");
const sourceIconSvg = resolve(packageDir, "assets", "AppIcon.svg");
function commandExists(command) {
try {
@ -129,8 +130,30 @@ function writeIcon() {
rmSync(iconsetDir, { recursive: true, force: true });
mkdirSync(iconsetDir, { recursive: true });
const sizes = [16, 32, 64, 128, 256, 512, 1024];
for (const size of sizes) {
writeFileSync(resolve(iconsetDir, `icon_${size}x${size}.png`), makePng(size));
const canRenderSvgIcon = existsSync(sourceIconSvg) && commandExists("sips");
if (canRenderSvgIcon) {
for (const size of sizes) {
execFileSync(
"sips",
[
"-s",
"format",
"png",
"--resampleHeightWidth",
String(size),
String(size),
sourceIconSvg,
"--out",
resolve(iconsetDir, `icon_${size}x${size}.png`),
],
{ stdio: "ignore" },
);
}
} else {
for (const size of sizes) {
writeFileSync(resolve(iconsetDir, `icon_${size}x${size}.png`), makePng(size));
}
}
if (process.platform === "darwin" && commandExists("iconutil")) {