1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/execlineb -P
piperw 3 4
background {
importas XDG_RUNTIME_DIR XDG_RUNTIME_DIR
dbus-daemon --session --address unix:path=${XDG_RUNTIME_DIR}/fakebus --print-address=4
}
fdclose 4
# Replace the last 'exit 0' here with commands that run after the daemon.
# Or swap the background/foreground to run dbus via a service manager.
if { fdmove 0 3 forstdin -x0 i exit 0 } fdclose 3 exit 0