Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add icon to linux build #146

Closed
MadejaMaciej opened this issue Apr 15, 2024 · 4 comments · Fixed by #190
Closed

Add icon to linux build #146

MadejaMaciej opened this issue Apr 15, 2024 · 4 comments · Fixed by #190
Assignees
Labels
feature New feature or request, requires business analysis in most cases

Comments

@MadejaMaciej
Copy link
Contributor

It is not loading currently after installation. Probably needs other properties or sizes additionally.

@MadejaMaciej MadejaMaciej added the feature New feature or request, requires business analysis in most cases label Apr 15, 2024
@MadejaMaciej MadejaMaciej self-assigned this Apr 15, 2024
@mrfatguy
Copy link
Contributor

mrfatguy commented Apr 15, 2024

Electron guide says that 512x512 pixels .png for Linux is correct.

Did you noticed extra remarks for Linux?

Configuring the path to your icon must be done in both package.json as well as in Electron's main process.

forge.config.js:

module.exports = {
  // ...
  makers: \[
    {
      name: '@electron-forge/maker-deb',
        config: {
          options: {
            icon: '/path/to/icon.png'
          }
      }
    }
  ]
  // ...
}

The icon must be additionally loaded when instantiating your BrowserWindow.

main.js (Main Process):

const { BrowserWindow } = require('electron')

const win = new BrowserWindow({
  // ...
  icon: '/path/to/icon.png'
})

Once the path to the icon has been configured, build your project to generate your executable with either npm run make.

I think this is important.

@MadejaMaciej
Copy link
Contributor Author

We do not use forge anymore to build any of the apps, as electron-builder is just better and easier to work with. I had to look what to do about that, as just icon property should do the trick. Might be that I should use 512px as you said instead of 256px (windows default) and that is all.

BrowserWindow might be a good shout for every platform. Will check it.

@MadejaMaciej
Copy link
Contributor Author

Think I found it:

icon String - The path to icon set directory or one png file, relative to the build resources or to the project directory. The icon filename must contain the size (e.g. 32x32.png) of the icon. So it should be just 512x512.png instead of favicon.png.

MadejaMaciej added a commit that referenced this issue Apr 15, 2024
@MadejaMaciej
Copy link
Contributor Author

Unfortunately after some tries it didn't work, need to search for something else. Will pick it up again after I transfer and tweak code for mobile, so for a moment now will be "feature stop".

After that I will be working on rest of the task that are In Progress first and then the rest from To Do and Backlog lists.

MadejaMaciej added a commit that referenced this issue May 8, 2024
MadejaMaciej added a commit that referenced this issue May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request, requires business analysis in most cases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants