Files
cindy/apps/desktop/src/main/linuxPasswordStore.ts
Dash 891a66c7bb feat(linux): support managed user installs and updates on Arch/Omarchy (#3922)
* feat(linux): support managed user installs and updates on Arch/Omarchy

Add verified user-owned installation transactions, stable desktop and login callbacks, and keyring selector preservation. Document migration and release acceptance; cover native updater failures and Linux test fixtures.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

* fix(linux): recover managed install transaction

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

---------

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-09-17 18:59:15 +07:00

34 lines
1.2 KiB
TypeScript

/** Preserve only the storage selector, not URLs or transient task arguments. */
export function linuxPasswordStoreRelaunchArgs(value: string): string[] {
return ['gnome-libsecret', 'kwallet', 'kwallet5', 'kwallet6', 'basic'].includes(value)
? [`--password-store=${value}`] : [];
}
/** Configure before Electron's ready event, without probing or opening the keyring. */
export function configureLinuxPasswordStore({
platform,
env,
commandLine,
}: {
platform: NodeJS.Platform;
env: NodeJS.ProcessEnv;
commandLine: {
hasSwitch(name: string): boolean;
appendSwitch(name: string, value: string): void;
};
}): void {
if (platform !== 'linux' || commandLine.hasSwitch('password-store')) return;
// Chromium does not recognize Hyprland (including Omarchy) as a desktop
// with a secret store. Prefer the active desktop over legacy session hints
// so a stale DESKTOP_SESSION cannot override GNOME/KDE's native selection.
const desktop =
env.XDG_CURRENT_DESKTOP?.trim() ||
env.XDG_SESSION_DESKTOP?.trim() ||
env.DESKTOP_SESSION?.trim() ||
'';
if (desktop.split(':').some((name) => name.trim().toLowerCase() === 'hyprland')) {
commandLine.appendSwitch('password-store', 'gnome-libsecret');
}
}