authorgravatar for me@disilla.orgEllie Gummere <me@disilla.org> 2026-03-31 23:07:51-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-31 20:07:51-07:00
log0a88719a3abdf80a01096e6c324aa1d3b5650920
tree233ac5e15bec448a2a10e9e5a79438ebb79a72df
parent0bc94bc24ec221e2ea7c370c9bfb2b06af9ae573
signature Signed by PGP key B5690EEEBB952194

Improve Linux desktop identity packaged builds (#1201)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

2 files changed, 20 insertions(+), 1 deletions(-)

apps/desktop/src/main.ts+13
...@@ -66,6 +66,8 @@ const ROOT_DIR = Path.resolve(__dirname, "../../..");...@@ -66,6 +66,8 @@ const ROOT_DIR = Path.resolve(__dirname, "../../..");
66const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);66const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);
67const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";67const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
68const APP_USER_MODEL_ID = "com.t3tools.t3code";68const APP_USER_MODEL_ID = "com.t3tools.t3code";
69const LINUX_DESKTOP_ENTRY_NAME = isDevelopment ? "t3code-dev.desktop" : "t3code.desktop";
70const LINUX_WM_CLASS = isDevelopment ? "t3code-dev" : "t3code";
69const USER_DATA_DIR_NAME = isDevelopment ? "t3code-dev" : "t3code";71const USER_DATA_DIR_NAME = isDevelopment ? "t3code-dev" : "t3code";
70const LEGACY_USER_DATA_DIR_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";72const LEGACY_USER_DATA_DIR_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
71const COMMIT_HASH_PATTERN = /^[0-9a-f]{7,40}$/i;73const COMMIT_HASH_PATTERN = /^[0-9a-f]{7,40}$/i;
...@@ -80,6 +82,9 @@ const DESKTOP_UPDATE_CHANNEL = "latest";...@@ -80,6 +82,9 @@ const DESKTOP_UPDATE_CHANNEL = "latest";
80const DESKTOP_UPDATE_ALLOW_PRERELEASE = false;82const DESKTOP_UPDATE_ALLOW_PRERELEASE = false;
8183
82type DesktopUpdateErrorContext = DesktopUpdateState["errorContext"];84type DesktopUpdateErrorContext = DesktopUpdateState["errorContext"];
85type LinuxDesktopNamedApp = Electron.App & {
86 setDesktopName?: (desktopName: string) => void;
87};
8388
84let mainWindow: BrowserWindow | null = null;89let mainWindow: BrowserWindow | null = null;
85let backendProcess: ChildProcess.ChildProcess | null = null;90let backendProcess: ChildProcess.ChildProcess | null = null;
...@@ -263,6 +268,10 @@ function captureBackendOutput(child: ChildProcess.ChildProcess): void {...@@ -263,6 +268,10 @@ function captureBackendOutput(child: ChildProcess.ChildProcess): void {
263268
264initializePackagedLogging();269initializePackagedLogging();
265270
271if (process.platform === "linux") {
272 app.commandLine.appendSwitch("class", LINUX_WM_CLASS);
273}
274
266function getDestructiveMenuIcon(): Electron.NativeImage | undefined {275function getDestructiveMenuIcon(): Electron.NativeImage | undefined {
267 if (process.platform !== "darwin") return undefined;276 if (process.platform !== "darwin") return undefined;
268 if (destructiveMenuIconCache !== undefined) {277 if (destructiveMenuIconCache !== undefined) {
...@@ -715,6 +724,10 @@ function configureAppIdentity(): void {...@@ -715,6 +724,10 @@ function configureAppIdentity(): void {
715 app.setAppUserModelId(APP_USER_MODEL_ID);724 app.setAppUserModelId(APP_USER_MODEL_ID);
716 }725 }
717726
727 if (process.platform === "linux") {
728 (app as LinuxDesktopNamedApp).setDesktopName?.(LINUX_DESKTOP_ENTRY_NAME);
729 }
730
718 if (process.platform === "darwin" && app.dock) {731 if (process.platform === "darwin" && app.dock) {
719 const iconPath = resolveIconPath("png");732 const iconPath = resolveIconPath("png");
720 if (iconPath) {733 if (iconPath) {
scripts/build-desktop-artifact.ts+7-1
...@@ -502,8 +502,14 @@ const createBuildConfig = Effect.fn("createBuildConfig")(function* (...@@ -502,8 +502,14 @@ const createBuildConfig = Effect.fn("createBuildConfig")(function* (
502 if (platform === "linux") {502 if (platform === "linux") {
503 buildConfig.linux = {503 buildConfig.linux = {
504 target: [target],504 target: [target],
505 executableName: "t3code",
505 icon: "icon.png",506 icon: "icon.png",
506 category: "Development",507 category: "Development",
508 desktop: {
509 entry: {
510 StartupWMClass: "t3code",
511 },
512 },
507 };513 };
508 }514 }
509515
...@@ -648,7 +654,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (...@@ -648,7 +654,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
648 yield* fs.copy(stageResourcesDir, path.join(stageAppDir, "apps/desktop/prod-resources"));654 yield* fs.copy(stageResourcesDir, path.join(stageAppDir, "apps/desktop/prod-resources"));
649655
650 const stagePackageJson: StagePackageJson = {656 const stagePackageJson: StagePackageJson = {
651 name: "t3-code-desktop",657 name: "t3code",
652 version: appVersion,658 version: appVersion,
653 buildVersion: appVersion,659 buildVersion: appVersion,
654 t3codeCommitHash: commitHash,660 t3codeCommitHash: commitHash,