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, "../../..");
6666const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);
6767const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
6868const 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";
6971const USER_DATA_DIR_NAME = isDevelopment ? "t3code-dev" : "t3code";
7072const LEGACY_USER_DATA_DIR_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
7173const COMMIT_HASH_PATTERN = /^[0-9a-f]{7,40}$/i;
......@@ -80,6 +82,9 @@ const DESKTOP_UPDATE_CHANNEL = "latest";
8082const DESKTOP_UPDATE_ALLOW_PRERELEASE = false;
8183
8284type DesktopUpdateErrorContext = DesktopUpdateState["errorContext"];
85type LinuxDesktopNamedApp = Electron.App & {
86 setDesktopName?: (desktopName: string) => void;
87};
8388
8489let mainWindow: BrowserWindow | null = null;
8590let backendProcess: ChildProcess.ChildProcess | null = null;
......@@ -263,6 +268,10 @@ function captureBackendOutput(child: ChildProcess.ChildProcess): void {
263268
264269initializePackagedLogging();
265270
271if (process.platform === "linux") {
272 app.commandLine.appendSwitch("class", LINUX_WM_CLASS);
273}
274
266275function getDestructiveMenuIcon(): Electron.NativeImage | undefined {
267276 if (process.platform !== "darwin") return undefined;
268277 if (destructiveMenuIconCache !== undefined) {
......@@ -715,6 +724,10 @@ function configureAppIdentity(): void {
715724 app.setAppUserModelId(APP_USER_MODEL_ID);
716725 }
717726
727 if (process.platform === "linux") {
728 (app as LinuxDesktopNamedApp).setDesktopName?.(LINUX_DESKTOP_ENTRY_NAME);
729 }
730
718731 if (process.platform === "darwin" && app.dock) {
719732 const iconPath = resolveIconPath("png");
720733 if (iconPath) {
scripts/build-desktop-artifact.ts+7-1
......@@ -502,8 +502,14 @@ const createBuildConfig = Effect.fn("createBuildConfig")(function* (
502502 if (platform === "linux") {
503503 buildConfig.linux = {
504504 target: [target],
505 executableName: "t3code",
505506 icon: "icon.png",
506507 category: "Development",
508 desktop: {
509 entry: {
510 StartupWMClass: "t3code",
511 },
512 },
507513 };
508514 }
509515
......@@ -648,7 +654,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
648654 yield* fs.copy(stageResourcesDir, path.join(stageAppDir, "apps/desktop/prod-resources"));
649655
650656 const stagePackageJson: StagePackageJson = {
651 name: "t3-code-desktop",
657 name: "t3code",
652658 version: appVersion,
653659 buildVersion: appVersion,
654660 t3codeCommitHash: commitHash,