Repository navigation
feat(v3/linux): generate correctly sized hicolor icons for Linux packages #5917
Description
Problem
wails3 generate icons produces Windows .ico and macOS .icns assets, but no Linux desktop icon set.
The canonical default build/appicon.png is 1024×1024 after #5610, while the Linux nFPM template copies it unchanged into /usr/share/icons/hicolor/128x128/apps/<binary>.png. The bitmap dimensions therefore do not match the fixed-size directory. The freedesktop icon theme specification requires at least a 48×48 application icon and supports additional fixed sizes for better desktop and high-DPI rendering.
Applications currently need custom ImageMagick or similar scripts, adding an external dependency and potentially non-deterministic metadata.
Proposed solution
Extend wails3 generate icons with independent Linux options:
wails3 generate icons \
-input build/appicon.png \
-linuxoutputdir build/linux/icons \
-linuxsizes 16,32,48,64,128,256,512The generator should:
- use Go-native PNG decoding, resizing, and encoding on Linux, macOS, and Windows hosts;
- preserve aspect ratio and transparency, centering non-square sources on a transparent square canvas;
- produce exact, byte-deterministic
<size>x<size>.pngfiles; - stage the complete set before publication, never expose partially written PNGs, and recover the previous complete set on the next invocation after an interrupted replacement;
- validate sizes and keep the existing ICO
-sizesbehavior unchanged.
Fresh project Taskfiles should declare every Linux PNG as a generated output so one missing size triggers regeneration. The nFPM template should install each image into its matching hicolor directory for DEB, RPM, and Arch packages. AppImage can continue using the canonical source image.
Existing projects must remain packageable when update build-assets refreshes nFPM files without replacing their older Taskfile.
Acceptance criteria
- Linux icons require no external executable.
- Every PNG has the dimensions named by its file and package directory.
- Identical input produces byte-identical output.
- Non-square and transparent input is preserved without stretching.
- Invalid sizes fail explicitly.
- Fresh DEB, RPM, and Arch package configurations contain the complete default set.
- Existing Windows and macOS generation remains compatible.
- Documentation identifies
build/appicon.pngas canonical and Linux PNGs as generated assets.
Related to #4025.
Complements #4575.
Specification: https://specifications.freedesktop.org/icon-theme/latest/index.html#install_icons
Activity
coderabbitai commentedon Aug 6, 2026
🔗 Related PRs
#4477 - [v3] fix linux .desktop file appicon variable [merged]
#4780 - feat(linux): generate .desktop file during build (
#4575) [merged]#5610 - fix(v3/icons): update default macOS icons for Tahoe full-bleed style [merged]
#5627 - test(v3/icons): assert .ico is small, not an exact byte size [merged]
#5825 - fix(v3/cli): give
generate iconsits documented default paths [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
taliesin-ai commentedon Oct 15, 2026
Hi there! Thanks for the suggestion. I'll leave this open for us to consider when planning future work.