Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
import { execFileSync } from 'node:child_process';

import { app } from 'electron';
import log from 'electron-log';
import { menubar } from 'menubar';

// On Linux tiling WMs (Hyprland, Sway, i3, etc.), Electron fails to detect the
// correct password storage backend because XDG_CURRENT_DESKTOP doesn't match a
// known DE. Query D-Bus for an active Secret Service provider and, if found, tell
// Electron to use gnome-libsecret so safeStorage works correctly.
if (
process.platform === 'linux' &&
!app.commandLine.hasSwitch('password-store')
) {
try {
execFileSync(
'dbus-send',
[
'--session',
'--dest=org.freedesktop.DBus',
'--type=method_call',
'--print-reply',
'/org/freedesktop/DBus',
'org.freedesktop.DBus.GetNameOwner',
'string:org.freedesktop.secrets',
],
{ timeout: 2000, stdio: 'ignore' },
);
app.commandLine.appendSwitch('password-store', 'gnome-libsecret');
} catch {
// D-Bus not available or no Secret Service provider — let Electron fall back
}
}

import { Paths, WindowConfig } from './config';
import {
registerAppHandlers,
Expand Down