Created
February 7, 2022 14:01
-
-
Save subnut/0e4a72d931c74e91087fd1481a30e023 to your computer and use it in GitHub Desktop.
Alternative to dbus-run-session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
{ { ADDRESS=$(dbus-daemon --session --print-address 1 --print-pid 2 --fork); } 2>&1 | |
echo $ADDRESS; } | { tr '\n' ' '; echo; } | | |
read DBUS_DAEMON_PID DBUS_SESSION_BUS_ADDRESS | |
export DBUS_SESSION_BUS_ADDRESS | |
"$@"; EXITCODE=$? | |
kill $DBUS_DAEMON_PID | |
exit $EXITCODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment