1 # get standard environment, filters and checks
14 # hackery for dbus-based environments
16 unset DBUS_SESSION_BUS_PID DBUS_SESSION_BUS_ADDRESS
17 if which dbus-daemon >/dev/null 2>&1
20 # https://github.com/flatpak/flatpak/commit/6cc8062cfb3f9410d54a27e7ccca77c103e441e8
21 # to address https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836285
23 dbus-daemon --fork --session --print-address=3 --print-pid=4 3>$tmp.dbus.address 4>$tmp.dbus.pid
24 export DBUS_SESSION_BUS_ADDRESS="`cat $tmp.dbus.address`"
25 DBUS_SESSION_BUS_PID="`cat $tmp.dbus.pid`"
26 if kill -0 "$DBUS_SESSION_BUS_PID" >/dev/null 2>&1
30 echo "common.qt: Failed to start dbus-daemon"
34 # general trap handler cleanup routine for qt checkers
37 # if we started a dbus-daemon above, we should clean it up
38 [ -z "$DBUS_SESSION_BUS_PID" ] || kill $DBUS_SESSION_BUS_PID
39 unset DBUS_SESSION_BUS_PID DBUS_SESSION_BUS_ADDRESS