look for DBUS_SESSION_BUS_ADDRESS if not set

if DBUS_SESSION_BUS_ADDRESS is not set (like if running from crontab)
we end up with a fresh dbus session. This breaks things like access to
secret service (password manager).

If DBUS_SESSION_BUS_ADDRESS is empty, look in several locations inside
XDG_RUNTIME_DIR (/run/user/<uid>/) and if an existing dbus session bus
address is found, update DBUS_SESSION_BUS_ADDRESS with that and
continue.
2 files changed