Skip to content

fix(desktop): give Linux an icon set hicolor can find - #1

Merged
rldona merged 1 commit into
mainfrom
linux-hicolor-icons
Nov 5, 2026
Merged

rldona merged 1 commit into
mainfrom
linux-hicolor-icons

Conversation

@rldona

@rldona rldona commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Problem

The OpenNote 0.5.0 .deb (opennote-desktop) installs only /usr/share/icons/hicolor/1024x1024/apps/opennote.png. The hicolor theme only goes up to 512x512, so Icon=opennote in opennote.desktop never finds an icon and Ubuntu shows the generic one.

Fix

  • desktop/scripts/make-icons.mjs draws the same geometry at every hicolor size (16, 22, 24, 32, 48, 64, 128, 256, 512) into desktop/build/icons/NxN.png. The shapes are defined on the 1024 grid and drawn at each target size. Regenerating leaves icon.png and icon-mac.png byte-for-byte the same.
  • electron-builder.yml: linux.icon now points to build/icons, so the .deb installs hicolor/<size>/apps/opennote.png.
  • Window icon: the windows already set icon: appIcon() from dist/icon.png, so an AppImage or build that was never integrated still shows the logo in the dock. No change was needed there.
  • desktop/test/icons.test.mjs (node --test, now part of root npm test) checks that build/icons contains exactly the hicolor sizes and that each PNG header has the size in its file name.

Verified

I built the package locally with electron-builder --linux deb --x64 and listed it with dpkg-deb -c. It contains usr/share/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/opennote.png and no 1024x1024.

🤖 Generated with Claude Code

The .deb shipped only the 1024x1024 icon.png. The freedesktop hicolor theme stops at 512x512, so
`Icon=opennote` never resolved and Ubuntu drew the generic icon.

make-icons.mjs now draws the same geometry at every hicolor size (16, 22, 24, 32, 48, 64, 128,
256, 512) into build/icons, and electron-builder's Linux icon points at that directory.
icon.png and icon-mac.png come out byte-identical. The windows already set their own icon from
dist/icon.png, so an unintegrated build still shows the mark in the dock. A test keeps the set
at the sizes hicolor declares and is now part of `npm test`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rldona
rldona merged commit f090b86 into main Nov 5, 2026
5 checks passed
@rldona
rldona deleted the linux-hicolor-icons branch November 5, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant