20 lines
705 B
JavaScript
20 lines
705 B
JavaScript
const { app, nativeImage } = require('electron');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
app.whenReady().then(() => {
|
|
const iconPath = path.join(__dirname, '../../build/icon.png');
|
|
const image = nativeImage.createFromPath(iconPath);
|
|
|
|
const resized = image.resize({ width: 22, height: 22, quality: 'best' });
|
|
|
|
const pngPath = path.join(__dirname, '../../public/tray/tray-icon.png');
|
|
const pngPath2 = path.join(__dirname, '../../public/tray/tray-iconTemplate.png');
|
|
|
|
const pngBuffer = resized.toPNG();
|
|
fs.writeFileSync(pngPath, pngBuffer);
|
|
fs.writeFileSync(pngPath2, pngBuffer);
|
|
|
|
console.log('Saved resized built icon to', pngPath);
|
|
app.quit();
|
|
});
|