require 'formula' class DBus Label org.freedesktop.dbus-system ProgramArguments #{bin}/dbus-daemon --system --nofork OnDemand Disabled EOS end def caveats; <<-EOS The dbus system bus can auto-start with OS X, but it requires a symlink in your system library dir. Run the next two commands to hook things up: sudo ln -s #{prefix}/Library/LaunchAgents/org.freedesktop.dbus-session.plist /Library/LaunchAgents/org.freedesktop.dbus-session.plist sudo ln -s #{prefix}/Library/LaunchDaemons/org.freedesktop.dbus-system.plist /Library/LaunchDaemons/org.freedesktop.dbus-system.plist You will also need to make the two launchd files owned by root, otherwise OS X will complain: sudo chown root:admin #{prefix}/Library/LaunchAgents/org.freedesktop.dbus-session.plist sudo chown root:admin #{prefix}/Library/LaunchDaemons/org.freedesktop.dbus-system.plist Note that you will have to change them back to a user ownership, as well as remove the symlinks when uninstalling, as homebrew won't be able to erase them. If you want dbus to auto-start, run the following two commands: sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist Then it will autostart when needed from the next reboot. Also, if programs are having trouble connecting to the dbus session, add this to your /etc/profile: export DBUS_SESSION_BUS_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET" EOS end end