xsession: Update DBus activation environment

`dbus-launch` is executed early in the script, before desktop managers
had a chance to setup the environment. If DBus activation is used,
applications launched by this may therefore lack necessary environment
variables. This patch sends the complete environment to DBus after
launching the desktop manager.
This commit is contained in:
Christoph Ruegge 2016-04-14 11:28:10 +02:00
parent e5d00a28dd
commit f270af1acd

View file

@ -126,6 +126,14 @@ let
(*) echo "$0: Desktop manager '$desktopManager' not found.";;
esac
${optionalString cfg.startDbusSession ''
${pkgs.glib}/bin/gdbus call --session \
--dest org.freedesktop.DBus --object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.UpdateActivationEnvironment \
"{$(env | ${pkgs.gnused}/bin/sed "s/'/\\\\'/g; s/\([^=]*\)=\(.*\)/'\1':'\2'/" \
| ${pkgs.coreutils}/bin/paste -sd,)}"
''}
test -n "$waitPID" && wait "$waitPID"
exit 0
'';