How to export DBUS_SESSION_BUS_ADDRESS How to export DBUS_SESSION_BUS_ADDRESS linux linux

How to export DBUS_SESSION_BUS_ADDRESS


I've finally found the answer, running the following command exports the output of dbus-launch:

export $(dbus-launch)


pid_gnome=$(pgrep gnome-session)DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/${pid_gnome}/environ|cut -d= -f2-)export DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}

Please make sure that the user has the DISPLAY variable set.

Another alternative is:

export $(dbus-launch)


Type the following command into a terminal:

eval `dbus-launch --auto-syntax`