OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
apps-services high common DISPUTE

Fix xdg-desktop-portal not starting under Hyprland (no file dialogs, no screenshare)

archomarchyendeavouroscachyoshyprlandwaylandxwaylandxdg-desktop-portalgreetd
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

The systemd analysis is verified correct: upstream xdg-desktop-portal.service really does carry PartOf=graphical-session.target, Requisite=graphical-session.target, After=graphical-session.target, so the empty-assignment drop-in via systemctl --user edit is the right technique, and the danger note about not editing /usr/lib/systemd/user/ is right. What is stale is where the environment import goes: Hyprland 0.55+ deprecated hyprlang and reads ~/.config/hypr/hyprland.lua, and Omarchy 4 (Quattro) ships ~/.config/hypr/hyprland.lua + autostart.lua and starts the session under uwsm, so exec-once = ... lines added to ~/.config/hypr/hyprland.conf are silently ignored on both. Under uwsm the imports are also unnecessary, because uwsm already populates the systemd/D-Bus activation environment.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Do not edit /usr/lib/systemd/user/xdg-desktop-portal.service directly. The next xdg-desktop-portal package update overwrites it and the fix silently disappears. Use systemctl --user edit so the drop-in lands in ~/.config/systemd/user/.

Symptom

File-open dialogs never appear, screen sharing offers nothing to share, and systemctl --user status xdg-desktop-portal-hyprland shows the service failing or never starting. Sometimes it only breaks when Hyprland is launched from a bare TTY or via greetd.

Cause

xdg-desktop-portal-wlr and xdg-desktop-portal-hyprland require XDG_CURRENT_DESKTOP and WAYLAND_DISPLAY to be present in the systemd user session and the D-Bus activation environment. If the compositor is started without importing them, the backend has no way to talk to the compositor. Separately, launching from a TTY/greetd that never reaches graphical-session.target makes xdg-desktop-portal.service refuse to start because of its Requisite=graphical-session.target.

Fix

Diagnose the same way (systemctl --user show-environment | grep -E 'XDG_CURRENT_DESKTOP|WAYLAND_DISPLAY'), but fix it in the right place:

  • **Preferred (and the Omarchy 4 default): start Hyprland through uwsm** (uwsm start hyprland-uwsm.desktop), which exports the session environment to systemd and D-Bus for you, so no exec-once import lines are needed. If you are already on Omarchy 4 and the variables are missing, that is a session bug to report, not something to paper over in the config.
  • **If you launch Hyprland bare on 0.55+**, put the imports in the Lua config instead of hyprland.conf. On Omarchy that is ~/.config/hypr/autostart.lua (o.launch_on_start("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE"), same for the dbus-update-activation-environment --systemd ... line). Only a pre-0.55 Hyprland still takes the exec-once = form in hyprland.conf.

The systemctl --user edit xdg-desktop-portal.service drop-in ([Unit] with empty Requisite=, After=, PartOf=) and the xdg-desktop-portal-gtk DISPLAY=:0 drop-in stay exactly as written.

Verify

systemctl --user status xdg-desktop-portal-hyprland is active (running), and systemctl --user show-environment lists both variables. A file dialog from any GTK app now opens and returns the chosen file.

Sources

xdg-desktop-portal-not-starting-hyprland