sway: propagate Wayland env to dbus for portal backends

Without dbus-update-activation-environment, xdg-desktop-portal-{gtk,wlr}
inherit an empty WAYLAND_DISPLAY/SWAYSOCK from the session bus (started
by dbus-run-session before sway) and crash on activation. As a result
Flatpak apps cannot read color-scheme / gtk-theme from the host and fall
back to a light theme.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Fabio Scotto di Santolo
2026-05-17 07:57:10 +02:00
parent 1209afafd1
commit 279d440e3d

View File

@@ -74,6 +74,9 @@ for_window [class="(?i)polkit"] floating enable
for_window [title="^Authentication Required"] floating enable
# Autostart — XDG and session services
# Propagate Wayland env to dbus so xdg-desktop-portal backends inherit
# WAYLAND_DISPLAY/SWAYSOCK when dbus-activated (otherwise they crash).
exec dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP
exec dex --autostart --environment sway
exec gnome-keyring-daemon --start --components=secrets
exec_always ~/.config/sway/scripts/setup-gtk-theme.sh