fix: set window icon explicitly on Linux (GNOME/KDE)#334
Open
algojogacor wants to merge 1 commit into
Open
Conversation
Electron's BrowserWindow 'icon' option only applies to Windows and macOS. On Linux, the window icon must be set via nativeImage and setIcon() at runtime. Changes: - Import nativeImage from electron - After BrowserWindow creation on Linux, call setIcon() with the logo - Add 'icon' field to electron-builder linux config for proper packaging Fixes AgregoreWeb#10
RangerMauve
requested changes
May 18, 2026
Member
RangerMauve
left a comment
There was a problem hiding this comment.
Thanks for the PR!
One nitpick regarding the nativeImage init.
Also, was AI used to produce this PR?
| // Electron's BrowserWindow 'icon' option only applies to Windows/macOS | ||
| if (process.platform === 'linux') { | ||
| try { | ||
| const icon = nativeImage.createFromPath(LOGO_FILE) |
Member
There was a problem hiding this comment.
Can we init this once at the top and reuse it between instances, or do we need a fresh one each time?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #10: Agregore logo not showing as window icon on Linux desktop environments (GNOME/KDE).
Problem
Electron's
BrowserWindowiconoption only applies to Windows and macOS. On Linux, the window icon must be explicitly set usingnativeImage.createFromPath()andBrowserWindow.setIcon(). Additionally, the electron-builder Linux configuration was missing aniconfield for proper packaging.Solution
nativeImagefrom electronprocess.platform === 'linux') and callthis.window.setIcon()after BrowserWindow creation"icon": "build/icon.png"to thelinuxelectron-builder configuration for proper.desktopentry iconTesting
Type of Change