Skip to content

feat(v3/linux): generate correctly sized hicolor icons for Linux packages #5917

Open

Description

@mortenolsrud

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,512

The 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>.png files;
  • 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 -sizes behavior 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.png as 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

  1. coderabbitai commented on Aug 6, 2026

    @coderabbitai
    Contributor
    🔗 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 icons its documented default paths [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 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:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added this to the v3.1.0 milestone on Oct 13, 2026
  3. taliesin-ai commented on Oct 15, 2026

    @taliesin-ai
    Collaborator

    Hi there! Thanks for the suggestion. I'll leave this open for us to consider when planning future work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions