How to Bind runtime icon to electron app

Hello all,
I am trying to add the runtime icon to electron app under Ubuntu but with no success. I have tried to add the contribution to package.json:

"build": {
    "linux": {
      "target": [
        "AppImage",
        "deb"
      ],
      "icon": "resources/icon512-512.png"
    },

but it didnt work, so I found I have to add some icon definition to electron-builder.yml but also nothing, then I tried to add the icon to application.config.electron.windowOptions but still no success.
The path is correct, icon is present but still not displayed:
Screenshot from 2022-08-11 09-50-26

Am I missing something or could you give me any advice how to continue?
Thank you in advance

@CrixOv thank you for the discussion, based on the electron-builder documentation the linux icons will:

Linux icon set will be generated automatically based on the macOS icns file or common icon.png

The idea seems to specify the build directory if you provide a custom icon:

Or you can put them into the build/icons directory if you want to specify them yourself. The filename must contain the size (e.g. 256x256.png ) of the icon). Recommended sizes: 16, 32, 48, 64, 128, 256 (or just 512).

This is consistent with what I saw in their repo where they had similar questions: https://github.com/electron-userland/electron-builder/issues/2577#issuecomment-711122281.

Alternatively you can take a look at our blueprint example which does seem to work for me:

Hello,
I have tried to follow your advice, I have also tried to look at the Blueprint example, but unfortunately nothing works for me.

I have tried to follow your advice, I have also tried to look at the Blueprint example, but unfortunately nothing works for me.

Unfortunately I’m not sure how much more we can help, the issue seems unrelated to Eclipse Theia itself and it might be worthwhile to search online for issues related to electron-builder and Linux. It might be something simple as clearing your cache, or upgrading the builder version but it is difficult to tell.

Hello, I have tried to add the icon in completely new and clean branch and it works so I assume I added something wrong (do not know what) during the investigation. Thank you for your help.

1 Like