-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: update WM_CLASS on linux #4439
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
Open
opi3636
wants to merge
1
commit into
pear-devs:master
Choose a base branch
from
opi3636:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2
−4
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: pear-devs/pear-desktop
Length of output: 259
🌐 Web query:
What is the correct WM_CLASS identifier format for Electron apps on Linux desktop files?💡 Result:
The correct WM_CLASS identifier format for Electron apps on Linux desktop files is the lowercase, hyphenated version of the application's name (from package.json "name" field or set via app.setName), matching the actual WM_CLASS property set by Electron on the running windows. In the .desktop file, use StartupWMClass= followed by this exact string (case-sensitive match to xprop WM_CLASS(STRING) second value). To determine it: 1. Run the Electron app. 2. Use xprop | grep WM_CLASS and click the window. 3. WM_CLASS(STRING) = "instance", "class" — the "class" value (second one) is the identifier. For packaged apps (e.g., via electron-builder): - Defaults to lowercase of package.json "name" (e.g., "beekeeper-studio"). - Use "desktopName": "appname.desktop" in package.json; builders strip .desktop for StartupWMClass=appname. - Override explicitly in build config: "linux": { "desktop": { "StartupWMClass": "your-wmclass" } }. Electron derives WM_CLASS from app name (lowercase, normalized), while productName is display name. Mismatch causes icon/taskbar issues. Always verify with xprop for exact match.
Citations:
Use hyphens in WM_CLASS identifier to match Electron Linux conventions.
The identifier
com.github.th_ch.pear_musicuses underscores, which violates the standard Electron/Linux convention for WM_CLASS values. According to Electron builder standards, WM_CLASS should use lowercase, hyphenated format (e.g.,com.github.th-ch.pear-music). This should also align with the Windows identifier format at line 663 which uses hyphens (com.github.th-ch.youtube-music).Additionally, the application name differs between platforms:
pear_music(Linux) vsyoutube-music(Windows). Clarify whether this is an intentional rebrand or an incomplete migration, and ensure the identifier is consistent across all platforms using the correct format:com.github.th-ch.pear-music.🤖 Prompt for AI Agents