fix(nix): restore desktop app icon matching (#2506)

* fix(nix): identify desktop app for icon matching

* fix(desktop): ignore wrapper class in CLI passthrough

* fix(nix): give the Electron launcher a real app root

The Wayland app_id — what a bar or taskbar uses to find the .desktop
entry, and therefore the icon — is fixed during Electron startup, so
neither `--class=` nor main.ts's `app.setName()` reaches it on current
Electron. Launching `electron path/to/main.js` gives Electron no
package.json to read a name from, so the window published the default
"electron" app_id and shells drew the generic Electron icon.

Launch a one-file app root named "paseo-desktop" instead, matching the
installed desktop entry and hicolor icon. Older Electron (38) derives
the app_id from the runtime app name "Paseo", so also ship a NoDisplay
alias entry under that name; the icon resolves either way and the
launcher list still shows a single Paseo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Ivan Malison
2026-08-03 04:34:05 +08:00
committed by GitHub
co-authored by Claude Opus 5
parent fdb39d2111
commit 5d15e40a2b
3 changed files with 47 additions and 3 deletions
@@ -65,6 +65,23 @@ describe("passthrough CLI", () => {
).toBeNull();
});
it("ignores Linux desktop identity arguments injected by the Nix wrapper", () => {
expect(
parsePassthroughCliArgs({
argv: [
"/nix/store/electron/bin/electron",
"/nix/store/paseo-desktop/share/paseo-desktop/electron-app",
"--no-sandbox",
"--class=paseo-desktop",
"daemon",
"status",
],
isDefaultApp: true,
forceCli: false,
}),
).toEqual(["daemon", "status"]);
});
it("ignores Electron remote debugging switches", () => {
expect(
parsePassthroughCliArgs({
@@ -2,7 +2,7 @@ import { pathToFileURL } from "node:url";
import { resolvePassthroughCliEntrypoint } from "./entrypoints.js";
const DESKTOP_CLI_ENV = "PASEO_DESKTOP_CLI";
const IGNORED_ARG_PREFIXES = ["-psn_", "--no-sandbox", "--remote-debugging-port="];
const IGNORED_ARG_PREFIXES = ["-psn_", "--class=", "--no-sandbox", "--remote-debugging-port="];
export type PassthroughCliRunner = (argv: string[]) => Promise<number>;