dbus/dbus-session-profile.sh

12 lines
495 B
Bash

dbus_session_file=~/.dbus/session-bus/$(cat /var/lib/dbus/machine-id)-0
if [ -e "$dbus_session_file" ]; then
. "$dbus_session_file"
if [ "$DBUS_SESSION_BUS_PID" -a -e /proc/$DBUS_SESSION_BUS_PID -a \
"`readlink /proc/$DBUS_SESSION_BUS_PID/exe`" = "/usr/bin/dbus-daemon" ]; then
export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID DBUS_SESSION_BUS_WINDOWID
else
unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID DBUS_SESSION_BUS_WINDOWID
fi
fi
unset dbus_session_file