Improve password store detection on Linux tiling WMs#2660
Conversation
|
After digging deeper, I found that Electron has actually addressed this upstream in electron/electron#49054, which closes both electron/electron#39789 and electron/electron#47436. The fix introduces new async So there are two options:
|
|
It looks like you're not a member of this organization on Indent. To use Indent, visit app.indent.com to get started. |
|
Hey @BlueManCZ - thanks for submitting this and doing the research to figure out what is going on here. This is great news! I think the code here looks good, but it might be cleanest to wait for Electron 42 and let the fix happen upstream. Our usage of |
|
I agree. I'll stay in touch and will update this PR or create new one once I see you upgrade to Electron 42. |
|
It looks like you're not a member of this organization on Indent. To use Indent, visit app.indent.com to get started. |
Summary
On Linux tiling WMs (Hyprland, Sway, i3, etc.), Electron's
safeStorageAPI fails to detect the correct password storage backend, even when a keyring likegnome-keyringis installed and running. This causes the "Could not store your password securely" error on startup.The root cause is that Electron selects the backend based on the
XDG_CURRENT_DESKTOPenvironment variable. When it doesn't match a known desktop environment, it falls back tobasic_textand reportsisEncryptionAvailable: false— despiteorg.freedesktop.secretsbeing available on D-Bus.This PR adds a startup check that queries D-Bus for an active Secret Service provider. If one is found and the user hasn't explicitly passed
--password-store, it sets--password-store=gnome-libsecretso Electron uses the correct backend.Details
execFileSyncto calldbus-send— no shell spawned, no new dependencies--password-store=...flag the user passesRelated
--password-store=gnome-libsecretshould be set automatically for desktop environments that Electron can't recognize. A Sway user on Manjaro confirmed the workaround fixed the issue. This PR implements that suggestion.--password-store=gnome-libsecretin the snap wrapper.Tested on