Fix Obsidian Snap File Dialog on Fedora Wayland
Fixes the Obsidian Snap’s broken “Open folder as vault” button on
Fedora running GNOME/Wayland. The button appears to do nothing when
clicked — no file picker dialog appears and no error is shown to the
user. The root cause is a portal authentication failure between the
Snap’s Electron process and xdg-desktop-portal. This skill creates
a wrapper script and .desktop override that bypass the broken
Wayland portal path.
Root Cause
The Obsidian Snap (classic confinement) does not set
SNAP_DESKTOP_FILE in its environment. On Fedora 44+,
xdg-desktop-portal validates the calling application’s desktop
file identity via snap metadata. Without the DesktopFile key,
portal operations are silently denied:
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:
Portal operation not allowed: Key file does not have key
"DesktopFile" in group "Snap Info"
Electron’s dialog.showOpenDialog goes through the portal path
when --ozone-platform=wayland is active (auto-detected). The
portal denial causes the dialog promise to silently fail — no
dialog, no error visible to the user.
Prerequisites
- Fedora with GNOME and Wayland session
- Obsidian installed via Snap (
snap list obsidian) xdg-desktop-portalandxdg-desktop-portal-gnomeinstalled
Steps
-
Diagnose
Run the diagnostic script to confirm the issue applies:
bash ~/.agents/skills/fedora-obsidian-fix/scripts/diagnose.shThe script checks: Snap installation, Wayland session, portal services, and the portal error condition.
-
Apply the fix
Run the fix script to create the wrapper and desktop override:
bash ~/.agents/skills/fedora-obsidian-fix/scripts/fix.shThis creates:
~/.local/bin/obsidian-wrapper.sh— setsBAMF_DESKTOP_FILE_HINT,SNAP_DESKTOP_FILE,GTK_USE_PORTAL=1, and passes--ozone-platform=x11 --class=md.obsidian.Obsidianto Obsidian~/.local/share/applications/obsidian_md.obsidian.Obsidian.desktop— user-local.desktopoverride that launches via the wrapper~/.local/share/applications/obsidian_obsidian.desktop— shadows the Snap-provided default.desktopto prevent duplicate icon on the GNOME Dash
-
Restart Obsidian
Quit Obsidian completely and relaunch from the Dash (or run
~/.local/bin/obsidian-wrapper.shfrom terminal). -
Verify
Click “Open folder as vault” → the GNOME file picker should appear and the “Open” button should respond.
Gotchas
- Snap refreshes do not break the fix. The user-local
.desktopfile in~/.local/share/applications/takes priority over the snap-provided one in/var/lib/snapd/desktop/applications/. - Competing
.desktopfiles cause duplicate Dash icons. Snap installsobsidian_obsidian.desktopwith the sameStartupWMClass=md.obsidian.Obsidianas our user override. When GNOME sees two.desktopfiles claiming the sameStartupWMClass, it matches running windows to both — the pinned favorite gets one match, and the second file spawns a duplicate generic icon. The fix script shadows the Snap default with aHidden=trueoverride. --classflag is required with--ozone-platform=x11. Without it, Electron creates utility/splash windows with WM_CLASSObsidian(the binary name) while the main vault window usesmd.obsidian.Obsidian(the Electron app-id). The mixed WM_CLASS values can cause additional icon mismatches. The wrapper passes--class=md.obsidian.Obsidianto force all windows to use the same WM_CLASS that matches the.desktopfile’sStartupWMClass.- Stale SingletonLock. If Obsidian was killed without clean
shutdown,
~/.config/obsidian/SingletonLockmay be stale. The fix script removes it automatically. --ozone-platform=x11trade-off. This forces Electron to use XWayland instead of native Wayland. Visual differences are minimal (slightly different window decorations, no fractional scaling), but the file dialog works reliably.- The Vulkan warning is harmless. When running on Wayland,
Obsidian may log
'--ozone-platform=wayland' is not compatible with Vulkan. With the x11 override, this warning disappears. - GTK_USE_PORTAL=1 alone is insufficient. The env var makes
GTK apps route dialogs through the portal, but the portal itself
rejects the call due to the missing Snap desktop file identity.
The
--ozone-platform=x11bypasses the portal path entirely.
Verification
~/.local/bin/obsidian-wrapper.shexists and is executable- Wrapper includes
--class=md.obsidian.Obsidianand--ozone-platform=x11 ~/.local/share/applications/obsidian_md.obsidian.Obsidian.desktopexists andExec=points to the wrapper~/.local/share/applications/obsidian_obsidian.desktopexists withHidden=true(shadows Snap default)- No duplicate Obsidian icons on the GNOME Dash when running
- Obsidian launches from Dash without portal errors
- “Open folder as vault” → “Open” button opens the file picker
Changelog
See CHANGELOG.md for version history.