Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

fix: set StartupWMClass in the Linux desktop entry

drakeo338b0da760b7887
diff --git a/bin/helpers/merge.ts b/bin/helpers/merge.ts
index d8c45d6d..a2d58845 100644
--- a/bin/helpers/merge.ts
+++ b/bin/helpers/merge.ts
@@ -261,6 +261,7 @@ Icon=${linuxBinaryName}
Categories=Network;WebBrowser;Utility;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
+StartupWMClass=${linuxBinaryName}
Terminal=false
`;
}
diff --git a/dist/cli.js b/dist/cli.js
index 921cb762..b7ff14e3 100644
--- a/dist/cli.js
+++ b/dist/cli.js
@@ -1102,6 +1102,7 @@ Icon=${linuxBinaryName}
Categories=Network;WebBrowser;Utility;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
+StartupWMClass=${linuxBinaryName}
Terminal=false
`;
}
diff --git a/tests/unit/linux-desktop.test.ts b/tests/unit/linux-desktop.test.ts
index 5ca5db6d..bed41900 100644
--- a/tests/unit/linux-desktop.test.ts
+++ b/tests/unit/linux-desktop.test.ts
@@ -15,6 +15,16 @@ describe('buildLinuxDesktopContent', () => {
expect(desktopContent).not.toContain('Icon=example-app_512');
});
+ it('sets StartupWMClass so docks match the running window to the entry', () => {
+ const desktopContent = buildLinuxDesktopContent(
+ 'YouTube',
+ undefined,
+ 'pake-youtube',
+ );
+
+ expect(desktopContent).toContain('StartupWMClass=pake-youtube');
+ });
+
it('keeps the localized Chinese name when title contains Chinese text', () => {
const desktopContent = buildLinuxDesktopContent(
'MiaoYan',