D-Bus user service with Turnstile
I'm having a bit of trouble figuring out how to sort out a user service for D-Bus when using Turnstile. I've been aware for a long while that Turnstile is meant to handle exporting DBUS_SESSION_BUS_ADDRESS to the login environment, but I'm not sure that this is working right or I simply have no idea how to properly export it to the activation environment.
Currently, I'm having to effectively re-define and export the variable in the service's script as follows:
#!/bin/sh
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
dinitctl setenv DBUS_SESSION_BUS_ADDRESS || :
exec dbus-daemon --session --address="$DBUS_SESSION_BUS_ADDRESS" "$@"
The service itself:
type = process
load-options = sub-vars
command = $HOME/.config/dinit.d/scripts/dbus-session --print-address 3
smooth-recovery = true
ready-notification = pipefd:3