Skip to the content.

Fedora Desktop WMClass Fix

Audit and fix StartupWMClass mismatches in .desktop files for Electron apps on Fedora/GNOME/Wayland. When StartupWMClass is missing or uses the wrong case, GNOME cannot match a running window to its pinned launcher icon, causing a duplicate generic icon to appear on the taskbar (Window List) or dock. This skill detects the problem across all installed Electron apps and can fix them automatically.

Rules

Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution. If a command fails, report the actual error — do not guess.

Do NOT skip steps or combine multiple operations into one step. Execute each step in order and verify before proceeding.

This skill is purely mechanical — no semantic judgment is required. All decisions are made by the audit script. The agent MUST NOT interpret or evaluate results beyond what the script reports.

Prerequisites

Background: The Lowercase Convention

Electron apps on Wayland register their app-id using the lowercase binary name (derived from the name field in package.json or the executable filename). GNOME matches running windows to .desktop files using this app-id against the StartupWMClass field.

Binary Name Wayland app-id Required StartupWMClass
Goose goose goose
Hermes hermes hermes
Code code code

When StartupWMClass is missing, wrong-cased (e.g., Goose instead of goose), or absent entirely, GNOME shows:

  1. The pinned launcher icon (from favorites) — no running indicator
  2. A separate generic icon on the taskbar for the running window

This is a recurring problem because app reinstalls or updates often overwrite the system .desktop file with a default that lacks StartupWMClass or uses the original (wrong-cased) value.

Workflow

Step 1 — Audit

The agent MUST run the audit script to detect WMClass mismatches:

bash ~/.agents/skills/fedora-desktop-wmclass-fix/scripts/wmclass-audit.sh [--app NAME]

The agent MUST report the script output verbatim. Do NOT guess which apps have issues — the script detects them.

Step 2 — Fix

If mismatches are found, the agent MUST run the fix:

bash ~/.agents/skills/fedora-desktop-wmclass-fix/scripts/wmclass-audit.sh --fix [--app NAME]

The agent MUST report which files were modified.

Step 3 — Verify

The agent MUST instruct the user to restart the affected app(s) to confirm the duplicate icon is gone.

How the Script Works

The audit script (scripts/wmclass-audit.sh):

  1. Scans .desktop files in:
    • ~/.local/share/applications/ (user overrides)
    • /usr/share/applications/ (system)
    • /var/lib/flatpak/exports/share/applications/ (Flatpak)
    • /var/lib/snapd/desktop/applications/ (Snap)
  2. Detects Electron apps by checking for resources/app.asar adjacent to the binary referenced in the Exec= line.

  3. Computes the expected StartupWMClass by lowercasing the binary name (Electron’s Wayland convention).

  4. Compares current vs expected and reports:
    • ✅ OK — correct
    • ⚠️ MISSING — no StartupWMClass field
    • ⚠️ MISMATCH — value doesn’t match expected lowercase
  5. In --fix mode: copies system files to user dir if needed, sets/updates StartupWMClass, and refreshes the desktop database.

Gotchas

Verification

Changelog

See CHANGELOG.md for version history.