diff --git a/emacs.changes b/emacs.changes index e6c9542..79ea69c 100644 --- a/emacs.changes +++ b/emacs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 26 07:33:45 UTC 2017 - werner@suse.de + +- Use socket activation to get dbus up before starting emacs + ------------------------------------------------------------------- Tue Apr 25 14:51:25 UTC 2017 - werner@suse.de diff --git a/emacs.sh b/emacs.sh index 1cb6497..529465b 100644 --- a/emacs.sh +++ b/emacs.sh @@ -95,8 +95,8 @@ if test -n "$dbusdaemon" ; then DBUS_SESSION_BUS_ADDRESS=${dadd#*=} export DBUS_SESSION_BUS_ADDRESS done - if test -z "$DBUS_SESSION_BUS_ADDRESS" -a -S /run/user/${UID}/bus ; then - DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${UID}/bus + if test -z "$DBUS_SESSION_BUS_ADDRESS" -a -S "${XDG_RUNTIME_DIR}/bus" ; then + DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus" export DBUS_SESSION_BUS_ADDRESS fi fi @@ -114,6 +114,12 @@ if test -n "$dbusdaemon" ; then else arg0=emacs fi + elif test -S "${XDG_RUNTIME_DIR}/bus" ; then + dbusupdate=$(type -p dbus-update-activation-environment 2>/dev/null) + dbusstatus=$(systemctl --user is-active dbus.service 2>/dev/null) + if test -n "$dbusupdate" -a "$dbusstatus" != active ; then + $dbusupdate --systemd DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus" + fi fi unset dbuslaunch dbusdaemon fi