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.
Rules
Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution. If a command fails, report the actual error — do not guess.
Do NOT skip steps or combine multiple operations into one step. Execute each step in order and verify before proceeding.
Prerequisites
- Fedora with GNOME and Wayland session
- Obsidian installed via Snap (
snap list obsidian) xdg-desktop-portalandxdg-desktop-portal-gnomeinstalled
Workflow
Step 1 — Diagnose
The agent MUST run the diagnostic script to confirm the issue applies:
bash ~/.agents/skills/fedora-obsidian-fix/scripts/diagnose.sh
The agent MUST report the script output verbatim. The script checks: Snap installation, Wayland session, portal services, and the portal error condition.
Step 2 — Apply the fix
The agent MUST run the fix script:
bash ~/.agents/skills/fedora-obsidian-fix/scripts/fix.sh
The agent MUST report what the script created. Do NOT describe what the script will do before running it — run it first, then report the actual output.
Step 3 — Restart Obsidian
The agent MUST instruct the user to quit Obsidian completely and
relaunch from the Dash (or run ~/.local/bin/obsidian-wrapper.sh).
Step 4 — Verify
The agent MUST confirm the fix by checking:
test -x ~/.local/bin/obsidian-wrapper.sh && echo "✅ Wrapper exists"
test -f ~/.local/share/applications/obsidian_md.obsidian.Obsidian.desktop && echo "✅ Desktop override exists"
test -f ~/.local/share/applications/obsidian_obsidian.desktop && echo "✅ Shadow file exists"
The agent MUST instruct the user to click “Open folder as vault” → the GNOME file picker MUST appear.
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.