mirror of
https://github.com/db9979/sshtermy.git
synced 2026-12-05 20:34:07 +01:00
- assets/icon: grünes >_ mit Matrix-Regen, alle Größen als PNG, .ico, .icns; 16–64 px als vereinfachte Fassung, damit sie lesbar bleibt - Windows: Icon als Ressource in sshtermy.exe (rsrc_windows_*.syso, eigenes Werkzeug tools/icon/winres ohne Fremdabhängigkeit) - macOS: sshTermy.app bekommt das Icon; das Programm legt es selbst in die .app, so erhalten auch bestehende Installationen es nach dem Update - Linux: .deb mit hicolor-Icons und Startmenü-Eintrag - Webseite: Favicon, Apple-Touch-Icon, Logo in der Kopfzeile; README - make icon erzeugt alles neu Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUhyZeAnaXMQzGXmQU3
25 lines
1.2 KiB
JavaScript
25 lines
1.2 KiB
JavaScript
// SVG → PNG mit Chromium (Playwright), transparenter Hintergrund.
|
|
import { createRequire } from 'module';
|
|
import { readFileSync } from 'fs';
|
|
const { chromium } = createRequire(import.meta.url)('playwright');
|
|
import { join, dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
const dir = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'assets', 'icon');
|
|
const jobs = [
|
|
['sshtermy.svg', 'mac', [1024]],
|
|
['sshtermy-full.svg', 'sshtermy', [128, 256, 512, 1024]],
|
|
['sshtermy-small.svg', 'sshtermy', [16, 24, 32, 48, 64]],
|
|
];
|
|
const b = await chromium.launch();
|
|
const p = await b.newPage({ viewport: { width: 1024, height: 1024 } });
|
|
for (const [svg, prefix, sizes] of jobs) {
|
|
await p.setContent(`<body style="margin:0;background:transparent">${readFileSync(join(dir, svg), 'utf8')}</body>`);
|
|
for (const s of sizes) {
|
|
// Chromium verkleinert selbst (bessere Glut als Nachskalieren); 1024 als Ausgangsgröße
|
|
await p.setViewportSize({ width: s, height: s });
|
|
await p.evaluate(s => { const e = document.querySelector('svg'); e.setAttribute('width', s); e.setAttribute('height', s); }, s);
|
|
await p.screenshot({ path: join(dir, `${prefix}-${s}.png`), omitBackground: true });
|
|
}
|
|
}
|
|
await b.close();
|